Send a notification
const url = 'https://acme.mykreezalid.com/api/v1/notifications/send';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"type":"new_order_customer","object_id":185423}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://acme.mykreezalid.com/api/v1/notifications/send \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "type": "new_order_customer", "object_id": 185423 }'Sends one of the marketplace’s e-mails about an order: new_order_customer (order confirmation to the customer), new_order_supplier (new order to the vendor), order_accepted_customer, order_canceled_customer, order_canceled_supplier (cancellation, to the vendor), order_rejected_customer, order_shipping_fulfilment (shipment to the customer) and order_customer_confirmed (reception confirmed, to the vendor). object_id is the order’s identifier. Each call sends one e-mail: type takes a single value, so telling both the customer and the vendor takes one call per type, for instance order_canceled_customer then order_canceled_supplier for a cancellation.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The notification to send, one per call
Identifier of the order
Example
{ "type": "new_order_customer", "object_id": 185423}Responses
Section titled “Responses”The notification has been sent
object
object
Identifier of the e-mail sent
object
Body of the e-mail
YYYY-MM-DD HH:MM:SS
Kind of e-mail sent
Example
{ "success": true, "data": { "id": 234432, "object_id": 185423, "content": { "subject": "You have a new order" }, "created": "2023-01-18 23:42:27", "recipient": "jane@example.com", "transport": "email" }}type or object_id is missing, the type is unknown or not available, or the notification could not be sent: error says why.
object
Example
{ "success": false, "error": "Bad Request - Missing type parameter"}No order has this identifier.
object
Example
{ "success": false, "error": "Bad Request - Missing type parameter"}