Using the API Integration for Custom Systems
Was this article helpful?
Was this article helpful?
With the API integration, you can transfer orders directly from your own system to AutoLetter. This is ideal for custom developments, individual shop systems, or automated workflows that cannot be handled through the standard integrations (Billbee, Shopify).
Navigate to Integrations, click Add, and select API as the integration type.
Give it a descriptive name, e.g., "Custom Shop API" or "ERP System".
After saving, you will receive the API endpoint URL and can generate a JWT token for authentication.
You generate the JWT token for API authentication in your Workspace in AutoLetter. Keep this token secure and do not share it with unauthorized parties.
Orders are sent as a JSON array via POST request to the API endpoint. Authentication is handled via a Bearer JWT token in the Authorization header.
curl -X POST https://api.autoletter.eu/v2/orders \
-H "Authorization: Bearer YOUR_JWT_TOKEN" \
-H "Content-Type: application/json" \
-d '[
{
"OrderNumber": "ORD-2026-001",
"OrderId": "12345",
"Date": "2026-02-20T10:30:00Z",
"Total": 89.99,
"Address": {
"FirstName": "John",
"LastName": "Smith",
"Street": "Main Street",
"HouseNumber": "42",
"ZIP": "10115",
"City": "Berlin",
"Country": "DE"
}
}
]'
Each order must contain the following fields:
| Field | Type | Description |
|---|---|---|
OrderNumber | String | The order number |
OrderId | String | A unique order ID |
Date | String (ISO 8601) | The order date |
Total | Number | The total amount of the order |
Address | Object |
The Address object contains the delivery address and must include at least name, street, ZIP code, city, and country.
In addition to the required fields, you can submit the following optional fields:
| Field | Type | Description |
|---|---|---|
ExternalId | String | External reference ID from your system |
ShopId | String | Shop identifier for multi-shop operations |
InvoiceAddress | Object | Alternative billing address |
LetterAddress | Object | Alternative address for letter delivery |
Products |
By default, only new orders are created. If you want to update existing orders, add the allowUpdates parameter to your request:
{
"allowUpdates": true,
"orders": [...]
}
With allowUpdates enabled, orders with a matching OrderId will be updated instead of rejected.
Unlike Billbee and Shopify, the API integration has no synchronization delay. Orders you send via the API are immediately available in AutoLetter and can be used directly in campaigns.
The API returns standardized HTTP status codes:
In case of errors, the response contains detailed information about the affected records.
| The delivery address (see below) |
| Array |
| List of ordered products |