Skip to main content

Send Order Email

Sends an order email, such as the order confirmation, using the store's email templates. The event code in the URL selects which email is sent.

HTTP Request​

  • URL: /mail/{eventCode}?id={orderId}
  • Method: POST
  • Headers:
    • accessToken: Required. Your API access token.
  • Required scope: READ_ORDER or READ_WRITE_ORDER

Path Parameters​

ParameterTypeDescription
eventCodeStringRequired. The email to send. See Event Codes.

Query Parameters​

ParameterTypeDescription
idStringRequired. The ID of the order.

Event Codes​

Event codeEmail sent
order_confirmationOrder confirmation to the customer and the store.
erp_order_confirmationERP order confirmation to the customer, and order confirmation to the store.
erp_order_confirmation_without_priceERP order confirmation without prices to the customer, and order confirmation to the store.
order_pending_approvalOrder pending email to the customer, and approval request to the company's approvers.
order_approvedOrder approved email to the customer.
order_updatedOrder updated email to the customer.
order_fulfilledOrder fulfilled email to the customer.
order_status_updatedOrder status email to the customer, for orders that are fulfilled or cancelled.
order_payment_updatedPayment status email to the customer, for orders whose payment is declined or refunded.

cURL Example​

curl --location --request POST '<BASE_URL>/mail/erp_order_confirmation?id=664f2310d5775459152d6dd8' \
--header 'accessToken: <ACCESS_TOKEN>'

Response​

  • 200 OK: The email was sent.
  • 400 Bad Request: The order ID is missing or not valid, or the event code is not valid.
  • 404 Not Found: No order exists with this ID.
  • 500 Internal Server Error: The access token is missing or invalid, or the email could not be sent.

Sample JSON Response​

{
"success": true,
"message": "Order email triggered successfully",
"eventCode": "erp_order_confirmation"
}

Response Details​

Email Data​

FieldTypeDescription
successBooleanWhether the email was sent.
messageStringResult message.
eventCodeStringThe event code that was used.

Notes​

  • No request body is needed.
  • Recipients and content come from the store's email templates and the current order details.
  • order_approved and order_updated also notify your order update webhooks.
  • Confirmation and approval emails are not sent twice for the same order details.