You will need to send the URL, method and optional request body to Ecwid. The https://app.ecwid.com/api/v3/{STORE_ID}/
part of the request URL will be added automatically.
Batch request limit
Max amount of API requests for one batch request is 500.
In response, Ecwid will start executing your requests and provide you with a unique ticket ID for your batch request. Use that ticket ID to check the status of your batch request.
You can use stopOnFirstFailure
as a request parameter. If true
, Ecwid will stop executing requests when it detects first error response for an API request. Set false
to continue executing requests anyway. Default is true
. Learn more
Uploading product files or images
You can use batch API to upload files or images. However, they must be provided as a URL in the externalUrl
parameter. Sending binary data in request body is not supported.
Headers
Name | Type | Description |
---|---|---|
Authorization | string | oAuth token with mandatory Bearer before it. Example: Bearer e***s0 , where e***s0 should be replaced with your oAuth token. |
Request body
An array of JSON objects of type 'BatchRequest' with the following fields:
BatchRequest
Field | Type | Description |
---|---|---|
id | string | Set an optional request ID so you can find a specific request easier in the response |
path | string | Path to Ecwid REST API endpoint. Example: /orders?offset=100&[email protected]&paymentStatus=PAID,AWAITING_PAYMENT . It is not necessary to provide access token in this field. List of all API endpoints |
method | string | HTTP method you would like to use. Available methods: "GET" , "POST" , "PUT" , "DELETE" |
body | string | Optional request body for your requests. Required when creating new entities or updating them. For example: send new order details when creating orders, new product details when creating products and so on |
Response
A JSON object of type 'UpdateStatus' with the following fields:
UpdateStatus
Field | Type | Description |
---|---|---|
ticket | string | Ticket ID for your batch request. Use it to Get batch request status |
Errors
In case of error, Ecwid responds with an error HTTP status code and, optionally, JSON-formatted body containing error description
HTTP codes
HTTP Status | Description |
---|---|
400 | Request parameters are invalid |
415 | Unsupported content-type: expected application/json or text/json |
500 | Cannot update the order info because of an error on the server |
Error response body (optional)
Field | Type | Description |
---|---|---|
errorMessage | string | Error message |