Ecommerce data integration
Sync orders from your ecommerce platform to Subrite with the custom orders API. Covers credentials, authentication, the create or update order endpoint, error codes and best practices.
Sync orders from your ecommerce platform to Subrite with the custom orders API. Covers credentials, authentication, the create or update order endpoint, error codes and best practices.
Stay in the loop 🚀
This guide explains how to integrate your ecommerce platform with Subrite to sync order data. This integration allows you to:
Before you begin, you'll need:
sourceId: a unique identifier for your integrationContact the Subrite team to obtain these credentials.
The Ecommerce Data API allows you to create and update orders in Subrite. Each order must be associated with a valid Subrite member ID.
https://api.subrite.com/All API requests must include the following header:
Authorization: Bearer <your-jwt-token>Creates a new order or updates an existing one in Subrite. If an order with the same sourceId and sourceRef already exists, it will be updated.
POST /api/v1/custom-orders{
"sourceId": "string", // Required: Your integration's source ID
"sourceRef": "string", // Required: Your platform's order ID
"memberId": "string", // Required: Subrite member ID
"totalPrice": number, // Required: Order total before VAT
"totalPriceVat": number, // Required: Order total including VAT
"currency": "string", // Required: ISO 4217 currency code (ex. NOK, EUR, USD, GBP)
"orderTime": "datetime", // Optional: ISO 8601 datetime format
"items": [ // Required: Array of order items
{
"productId": "string",
"productName": "string",
"categoryId": "string",
"categoryName": "string",
"quantity": number,
"price": number,
"priceVat": number,
"customPropertyValues": {} // Optional: Additional item data (needs setup in Subrite before use)
}
],
"customPropertyValues": {} // Optional: Additional order data (needs setup in Subrite before use)
}Order fields:
| Field | Type | Required | Description |
|---|---|---|---|
sourceId | string | Yes | Your integration's source ID |
sourceRef | string | Yes | Your platform's order ID |
memberId | string | Yes |
Each entry in items has these fields:
| Field | Type |
|---|---|
productId | string |
productName | string |
categoryId | string |
categoryName | string |
quantity | number |
price | number |
priceVat | number |
The item customPropertyValues field is optional and holds additional item data. It needs setup in Subrite before use.
{
"id": "string",
"orderTime": "string",
"memberId": "string",
"sourceId": "string",
"sourceRef": "string",
"totalPrice": number,
"totalPriceVat": number,
"currency": "string",
"customPropertyValues": {},
"items": [
{
"id": "string",
"sequence": number,
"productId": "string",
"productName": "string",
"categoryId": "string",
"categoryName": "string",
"quantity": number,
"price": number,
"priceVat": number,
"customPropertyValues": {}
}
]
}The API uses standard HTTP status codes and returns error details in the response body:
{
"error": {
"code": "string",
"message": "string",
"details": {}
}
}Common error codes:
| Status code | Meaning |
|---|---|
400 | Bad Request: invalid input data |
401 | Unauthorized: invalid or missing authentication |
403 | Forbidden: insufficient permissions |
500 | Internal Server Error |
sourceRef when updating an existing order.If you need help with the integration, contact the Subrite support team at .
totalPrice | number | Yes | Order total before VAT |
totalPriceVat | number | Yes | Order total including VAT |
currency | string | Yes | ISO 4217 currency code (for example NOK, EUR, USD, GBP) |
orderTime | datetime | No | ISO 8601 datetime format |
items | array | Yes | Array of order items |
customPropertyValues | object | No | Additional order data (needs setup in Subrite before use) |
customPropertyValues | object |