> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developers.brevo.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developers.brevo.com/_mcp/server.

# Create orders in batch

POST https://api.brevo.com/v3/orders/status/batch
Content-Type: application/json

Creates multiple orders in one request instead of one order at a time. Each order is stored as a new entry rather than replacing a previous order with the same `id`, so [Get order details](/reference/get-orders) can return several entries with the same `id`.

Reference: https://developers.brevo.com/reference/create-batch-order

## Authentication

- `api-key` header (required) — The API key should be passed in the request headers as `api-key` for authentication.
- `Authorization` header (bearer token, required) — OAuth 2.0 client_credentials (machine-to-machine) grant. Exchange your app's client_id/client_secret for a short-lived Bearer token.

## Request

### Body (application/json)

This endpoint expects an object.

- `orders` (list of order, required) — array of order objects
- `historical` (boolean, optional, default: true) — Defines whether you want your orders to be considered as live data or as historical data (import of past data, synchronising data). True: orders will not trigger any automation workflows. False: orders will trigger workflows as usual.
- `notifyUrl` (string, optional) — Webhook URL to receive the status of the batch request

## Response

### 202

batch id created

- `batch_id` (double, required, nullable) — Batch ID of the request
- `count` (long, optional) — Number of orders

## Errors

### 400 Bad Request Error

bad request

- `code` (enum, required) — Error code displayed in case of a failure
  - Allowed values: `invalid_parameter`, `missing_parameter`, `out_of_range`, `campaign_processing`, `campaign_sent`, `document_not_found`, `not_enough_credits`, `permission_denied`, `duplicate_parameter`, `duplicate_request`, `method_not_allowed`, `unauthorized`, `account_under_validation`, `not_acceptable`, `bad_request`, `unprocessable_entity`, `Domain does not exist`, `Contact email not found`, `Attribute not found`, `Category id not found`, `Invalid parameters passed`, `Record(s) for identifier not found`, `Returned when query params are invalid`, `Returned when invalid data posted`, `Feed not found`, `Campaign ID not found`, `api-key not found`, `DMARC policy requires domain authentication`, `DNS records not properly configured`, `Invalid OTP code provided`, `OTP code has expired`, `Domain already exists in your account`, `The sum of all IP weights must equal 100`, `Authentication failed`, `Insufficient credits`, `Request already processed`
- `message` (string, required) — Readable message associated to the failure

## Types

### order

- `amount` (double, required) — Total amount of the order, including all shipping expenses, tax and the price of items.
- `createdAt` (string, required) — UTC date-time when the order was created, in ISO 8601 format ending in `Z` (for example `2021-07-29T20:59:23Z`). Fractional seconds are accepted (`2021-07-29T20:59:23.383Z`). Timezone offsets such as `+01:00` are not supported: convert the date to UTC first.
- `id` (string, required) — Unique ID of the order.
- `products` (list of OrderProductsItems, required)
- `status` (string, required) — State of the order.
- `updatedAt` (string, required) — UTC date-time when the order status was last changed, in ISO 8601 format ending in `Z` (for example `2021-07-30T10:59:23Z`). Fractional seconds are accepted (`2021-07-30T10:59:23.383Z`). Timezone offsets such as `+01:00` are not supported: convert the date to UTC first.
- `billing` (OrderBilling, optional) — Billing details of an order.
- `coupons` (list of string, optional) — Coupons applied to the order. Stored case insensitive.
- `identifiers` (OrderIdentifiers, optional) — Identifies the contact associated with the order.
- `shipping` (OrderShipping, optional) — Shipping details of an order, when the recipient or ship-to address differs from billing.
- `storeId` (string, optional) — ID of store where the order is placed
- `metaInfo` (map from string to OrderMetaInfo, optional) — Additional order details such as a custom message, customer type or source. Values can be strings, numbers or booleans. Strings in RFC 3339 format (for example `2021-07-29T20:59:23Z`) are stored as dates.

### OrderProductsItems

Details for the Products in an order.

- `price` (double, required) — The price of a unit of product
- `productId` (string, required) — ID of the product.
- `sku` (string, optional) — Stock Keeping Unit identifier for the product line item. Stored as sent: it is not matched against the product catalog.
- `variantId` (string, optional) — Product ID of the red color shirts.
- `quantity` (integer, optional) — **Required if quantityFloat is empty.** Number of product units added to the cart (whole numbers only, e.g., 10)
- `quantityFloat` (double, optional) — **Required if quantity is empty.** Number of product units added to the cart(supports decimals, e.g., 20.52)

### OrderBilling

Billing details of an order.

- `address` (string, optional) — Full billing address.
- `city` (string, optional) — Exact city of the address.
- `country` (string, optional) — Billing country name.
- `countryCode` (string, optional) — Billing country 2-letter ISO code.
- `paymentMethod` (string, optional) — How the visitor will pay for the item(s), e.g. paypal, check, etc.
- `phone` (string, optional) — Billing phone number.
- `postCode` (string, optional) — Billing postcode.
- `region` (string, optional) — Exact region (state/province) for billing.

### OrderIdentifiers

Identifies the contact associated with the order.

- `email_id` (string, optional) — Email of the contact associated with the order
- `ext_id` (string, optional) — ext_id associated with the order
- `loyalty_subscription_id` (string, optional) — loyalty_subscription_id associated with the order
- `phone_id` (string, optional) — Phone number of the contact associated with the order

### OrderShipping

Shipping details of an order, when the recipient or ship-to address differs from billing.

- `address` (string, optional) — Full shipping address.
- `city` (string, optional) — Exact city of the address.
- `country` (string, optional) — Shipping country name.
- `countryCode` (string, optional) — Shipping country 2-letter ISO code.
- `name` (string, optional) — Name of the shipping recipient.
- `phone` (string, optional) — Phone 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.
- `postCode` (string, optional) — Shipping postcode.
- `region` (string, optional) — Exact region (state/province) for shipping.

### OrderMetaInfo

- string
- double
- boolean

## Examples

**Request**

```json
{
  "orders": [
    {
      "amount": 308.42,
      "createdAt": "2021-07-29T20:59:23.383Z",
      "id": "14",
      "products": [
        {
          "price": 99.99,
          "productId": "P1"
        }
      ],
      "status": "completed",
      "updatedAt": "2021-07-30T10:59:23.383Z"
    }
  ]
}
```

**Response**

```json
{
  "batch_id": 1,
  "count": 17655
}
```

**SDK Code**

```python
import requests

url = "https://api.brevo.com/v3/orders/status/batch"

payload = { "orders": [
        {
            "amount": 308.42,
            "createdAt": "2021-07-29T20:59:23.383Z",
            "id": "14",
            "products": [
                {
                    "price": 99.99,
                    "productId": "P1"
                }
            ],
            "status": "completed",
            "updatedAt": "2021-07-30T10:59:23.383Z"
        }
    ] }
headers = {
    "api-key": "<api-key>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.brevo.com/v3/orders/status/batch';
const options = {
  method: 'POST',
  headers: {'api-key': '<api-key>', 'Content-Type': 'application/json'},
  body: '{"orders":[{"amount":308.42,"createdAt":"2021-07-29T20:59:23.383Z","id":"14","products":[{"price":99.99,"productId":"P1"}],"status":"completed","updatedAt":"2021-07-30T10:59:23.383Z"}]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.brevo.com/v3/orders/status/batch"

	payload := strings.NewReader("{\n  \"orders\": [\n    {\n      \"amount\": 308.42,\n      \"createdAt\": \"2021-07-29T20:59:23.383Z\",\n      \"id\": \"14\",\n      \"products\": [\n        {\n          \"price\": 99.99,\n          \"productId\": \"P1\"\n        }\n      ],\n      \"status\": \"completed\",\n      \"updatedAt\": \"2021-07-30T10:59:23.383Z\"\n    }\n  ]\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("api-key", "<api-key>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.brevo.com/v3/orders/status/batch")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"orders\": [\n    {\n      \"amount\": 308.42,\n      \"createdAt\": \"2021-07-29T20:59:23.383Z\",\n      \"id\": \"14\",\n      \"products\": [\n        {\n          \"price\": 99.99,\n          \"productId\": \"P1\"\n        }\n      ],\n      \"status\": \"completed\",\n      \"updatedAt\": \"2021-07-30T10:59:23.383Z\"\n    }\n  ]\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.brevo.com/v3/orders/status/batch")
  .header("api-key", "<api-key>")
  .header("Content-Type", "application/json")
  .body("{\n  \"orders\": [\n    {\n      \"amount\": 308.42,\n      \"createdAt\": \"2021-07-29T20:59:23.383Z\",\n      \"id\": \"14\",\n      \"products\": [\n        {\n          \"price\": 99.99,\n          \"productId\": \"P1\"\n        }\n      ],\n      \"status\": \"completed\",\n      \"updatedAt\": \"2021-07-30T10:59:23.383Z\"\n    }\n  ]\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.brevo.com/v3/orders/status/batch', [
  'body' => '{
  "orders": [
    {
      "amount": 308.42,
      "createdAt": "2021-07-29T20:59:23.383Z",
      "id": "14",
      "products": [
        {
          "price": 99.99,
          "productId": "P1"
        }
      ],
      "status": "completed",
      "updatedAt": "2021-07-30T10:59:23.383Z"
    }
  ]
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'api-key' => '<api-key>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.brevo.com/v3/orders/status/batch");
var request = new RestRequest(Method.POST);
request.AddHeader("api-key", "<api-key>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"orders\": [\n    {\n      \"amount\": 308.42,\n      \"createdAt\": \"2021-07-29T20:59:23.383Z\",\n      \"id\": \"14\",\n      \"products\": [\n        {\n          \"price\": 99.99,\n          \"productId\": \"P1\"\n        }\n      ],\n      \"status\": \"completed\",\n      \"updatedAt\": \"2021-07-30T10:59:23.383Z\"\n    }\n  ]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "api-key": "<api-key>",
  "Content-Type": "application/json"
]
let parameters = ["orders": [
    [
      "amount": 308.42,
      "createdAt": "2021-07-29T20:59:23.383Z",
      "id": "14",
      "products": [
        [
          "price": 99.99,
          "productId": "P1"
        ]
      ],
      "status": "completed",
      "updatedAt": "2021-07-30T10:59:23.383Z"
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.brevo.com/v3/orders/status/batch")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```