Skip to navigation

Import your orders

Learn how to create and manage eCommerce orders via the Brevo API.
View as Markdown

Overview

You can manage your eCommerce orders through two endpoints:

  • Single order — POST /orders/status — create or update one order at a time.
  • Batch orders — POST /orders/status/batch — create up to 1,000 orders in a single request.

Both endpoints are listed in the API reference.

To use these endpoints, your account must have the Brevo eCommerce application enabled. See Activate the eCommerce App.


Managing the status of an order

Use POST https://api.brevo.com/v3/orders/status to create or update a single order.

curl --request POST \
--url https://api.brevo.com/v3/orders/status \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"id": "14",
"createdAt": "2021-07-29T20:59:23.383Z",
"updatedAt": "2021-07-30T10:59:23.383Z",
"status": "completed",
"amount": 308.42,
"storeId": "ST-21",
"identifiers": {
"email_id": "example@brevo.com",
"ext_id": "ext_id_1",
"loyalty_subscription_id": "loyalty_id_1",
"phone_id": "01559 032133"
},
"products": [
{
"productId": "P1",
"sku": "SKU-001",
"quantity": 10,
"variantId": "P100",
"price": 99.99
}
],
"billing": {
"address": "15 Somewhere Road, Brynmenyn",
"city": "Basel",
"country": "Canada",
"countryCode": "CA",
"phone": "01559 032133",
"postCode": "4052",
"paymentMethod": "PayPal",
"region": "Northwestern Switzerland"
},
"shipping": {
"name": "Jane Doe",
"address": "8 Market Street",
"city": "Zurich",
"country": "Switzerland",
"countryCode": "CH",
"phone": "01559 032134",
"postCode": "8001",
"region": "Zurich"
},
"coupons": ["EASTER15OFF"],
"metaInfo": {
"order_source": "Website",
"gift_message": "Happy Birthday!",
"customer_loyalty_tier": "Gold"
}
}'

Order attributes

The following fields are required: id, createdAt, updatedAt, status, amount, products.

AttributeTypeDescription
idStringUnique ID of the order.
createdAtStringUTC date-time when the order was created (YYYY-MM-DDTHH:mm:ssZ). Required.
updatedAtStringUTC date-time when the order status was last changed (YYYY-MM-DDTHH:mm:ssZ). Required.
statusStringState of the order (e.g. completed, cancelled). Required.
amountNumberTotal order amount including shipping and tax. Required.
productsArray of objectsProducts in the order. Required. See Products.
storeIdStringID of the store where the order was placed.
identifiersObjectIdentifies the contact associated with the order. See Identifiers.
billingObjectBilling details. See Billing.
shippingObjectShipping recipient and address. See Shipping.
couponsArray of stringsCoupons applied at checkout. Stored case-insensitively.
metaInfoObjectAdditional order metadata (string, integer, or boolean values).

Identifiers attribute

Use identifiers to link the order to a Brevo contact. At least one identifier is required.

AttributeTypeDescription
email_idStringEmail address of the contact.
phone_idStringPhone number of the contact.
ext_idStringExternal ID associated with the contact.
loyalty_subscription_idStringLoyalty subscription ID of the contact.

Products attribute

AttributeTypeDescription
productIdStringID of the product. Required.
skuStringStock Keeping Unit identifier of the line item. Stored as sent: it is not matched against the product catalog.
priceNumberUnit price of the product. Required.
quantityIntegerNumber of units (whole numbers only, e.g. 10). Required if quantityFloat is not provided.
quantityFloatNumberNumber of units (supports decimals, e.g. 20.52). Required if quantity is not provided.
variantIdStringID of the product variant.

Provide either quantity or quantityFloat for each product, not both.

Billing attribute

AttributeTypeDescription
addressStringFull billing address.
cityStringCity of the billing address.
countryStringBilling country name.
countryCodeStringBilling country as a 2-letter ISO code.
phoneStringBilling phone number. Required if no email identifier is provided.
postCodeStringBilling postcode.
paymentMethodStringPayment method used (e.g. PayPal, Check).
regionStringState or province for billing.

Shipping attribute

Use shipping when the ship-to address differs from the billing address, or when your platform sends both. All fields are optional.

AttributeTypeDescription
nameStringName of the shipping recipient.
addressStringFull shipping address.
cityStringCity of the shipping address.
regionStringState or province for shipping.
postCodeStringShipping postcode.
countryStringShipping country name.
countryCodeStringShipping country as a 2-letter ISO code.
phoneStringPhone number to contact for shipping questions. If invalid, it is dropped and the order is still accepted. Unlike billing.phone, it is never used to identify the contact.

Creating orders in batch

Use POST https://api.brevo.com/v3/orders/status/batch to create multiple orders in a single request.

You can include up to 1,000 orders per request, or a maximum payload size of 5 MB.

curl --request POST \
--url https://api.brevo.com/v3/orders/status/batch \
--header 'api-key: YOUR_API_KEY' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '{
"orders": [
{
"id": "order30",
"createdAt": "2021-07-27T08:52:14.111Z",
"updatedAt": "2021-07-27T08:52:14.948Z",
"status": "completed",
"amount": 1000,
"identifiers": {
"email_id": "test@example.com"
},
"products": [
{ "productId": "600", "quantity": 899, "price": 1 },
{ "productId": "100", "quantity": 500, "price": 1 },
{ "productId": "100", "variantId": "12", "sku": "SKU-100-12", "quantity": 100, "price": 1 }
],
"coupons": ["TEST100"],
"billing": {
"address": "15 Somewhere Road, Brynmenyn",
"city": "Basel",
"phone": "01559 032133"
},
"shipping": {
"name": "Jane Doe",
"address": "8 Market Street",
"city": "Zurich",
"countryCode": "CH"
}
}
],
"notifyUrl": "https://en.wikipedia.org/wiki/Webhook",
"historical": true
}'

Batch-specific attributes

Each order in the orders array follows the same schema as a single order, so each order can include or omit shipping on its own. The following additional fields apply to the batch request itself.

AttributeTypeDescription
ordersArray of objectsArray of order objects. Required.
notifyUrlStringWebhook URL called when the batch request completes, with the processing status.
historicalBooleanOptional. Defaults to true. When set to true, imports past orders without triggering automation workflows. When set to false, processes orders as live data and may trigger workflows.

Responses

ResponseDescription
204Single order event created successfully.
202Batch request accepted. Returns batchId and count.
400Bad request. Check the request body for errors.

A successful batch response returns:

{
"batchId": 1,
"count": 2
}