Appearance
ORDERS
List all Orders
To get a list of orders, send a GET request to /orders
sh
GET /orders
Pagination, Sorting, and Filtering
Add these parameters to the path to specify which orders will be returned in the response and how they will be organized:
Parameter | Default value | Description |
---|---|---|
page | 1 | The response to GET /orders is a page with a limited number of orders. This parameter determines the number of the page that will be sent in the response. |
items_per_page | 10 | Determines the number of orders on a page. |
sort_by | date | Determines the parameter by which the orders are sorted in the response. |
sort_order | desc | Determines the sorting order:asc—ascendingdesc—descending |
status | P - processed C -complete O -open F - failed D - declined B - backordered I - cancelled H - Return complete G - Return in progress N - Incomplete | |
user_id | Searches only for the orders placed by the customer with the specified ID. | |
Searches only for the orders placed by the customer with the specified email. | ||
invoice_id | Searches only for the orders with the specified invoice ID. | |
updated_at_from updated_at_to | Searches only for the orders last modified during the specified date period. |
Order status explained
Status | Description | Backend-Description |
---|---|---|
C | Complete - all work on the order was completed | Komplett (Versand abgeschlossen) |
P | Processed - the payment was received - ready to ship | Bezahlt und bereit zum Versand (P) |
O | Open - the order was placed and created in the store database, but it hasn’t been processed yet | Offen - Noch nicht bezahlt |
F | the payment transaction failed | Fehlgeschlagen |
D | Declined - the order was canceled by the store administrator. | Abgelehnt (Storniert vom Händler) |
I | Canceled - the order was canceled by the customer. | Storniert |
G | Return request from customer in progress. | Retoure in bearbeitung |
H | Return is processed and repaid | Retourniert |
B | the order hasn’t been processed yet, as it contains out-of-stock items. | Zurückgestellt / Retoure in bearbeitung |
N | Incomplete (see below). | Unvollständig |
E | Unpaid - The Customer got a notification with inctructions how to make the payment for his order | Noch nicht bezahlt |
That is how order statuses are assigned:
There is also one hidden initial status: Incomplete (N). It means that the order was created in the store database, and the system is awaiting the response from a payment method. This status cannot be set by administrator.
A customer places an order, and the order is placed with the Incomplete status which does not change the inventory.
If the customer uses an offline payment method, the order status changes to Open until the store administrator assigns a different status to the order.
If the customer uses an online payment method, a positive response of the payment gateway will change the order status to Processed. If the response is negative, no new order will be created, and the customer will be offered to place the order again.
Get a specific order
To get the full list of details for a specific order, send a GET request to /orders/<order_id>
For example:
sh
GET /orders/100
Response Format
- The order exists: HTTP/1.1 200 OK and JSON with order details.
- The order doesn’t exist: HTTP/1.1 404 Not Found.
Order Details
The fields below represent various order details.
Field | Values | Description |
---|---|---|
order_id | integer | A unique identifier of the order. |
status | string | The status of the order. A unique letter of the English alphabet is assigned to every order status as a means to refer to it. |
timestamp | integer | The https://en.wikipedia.org/wiki/Unix_time when the order was placed. |
company_id | integer | ID of the associated company |
issuer_id | integer | ID of the administrator who created the order via the admin panel. |
user_id | integer | A unique identifier of the user who placed the order. Orders placed by guests have user_id=0. |
firstname | string | Customer’s first name. |
lastname | string | Customer’s last name. |
string | Customer’s email. | |
phone | string | Customer’s phone number. |
lang_code | string | The code of the language which the customer selected when placing the order, for example en. |
total | float | The sum to be paid by the customer. |
discount | float | Total discount. |
subtotal | float | The order subtotal. |
subtotal_discount | float | Discount on the order subtotal. |
display_subtotal | float | The subtotal that will be displayed. |
invoice_id | integer | ID of the invoice. |
credit_memo_id | integer | ID of the credit memo. |
payment_id | integer | ID of the payment method. |
payment_info | array | Payment information. |
payment_method | object | |
payment_surcharge | float | The amount of payment surcharge. |
repaid | 0—no 1—yes | Defines if the order was repaid. |
products | object | The information about the ordered products. |
promotion_ids | string | A string of promotion IDs separated by commas. |
promotions | array | The data of applicable promotions. |
need_shipping | true false | Defines if the order requires shipping. |
shipping_ids | string | IDs of the shipping methods. |
shipping | array | The data of the shipping methods used in the order. |
shipping_id | integer | ID of the shipping method. |
need_shipment | true false | Defines if the order requires shipments. |
shipment_ids | string | A string of shipment IDs separated by commas. |
shipping_cost | float | The shipping cost. |
display_shipping_cost | float | The shipping cost that will be displayed. |
tax_exempt | Y—yes N—no | Determines if the customer is exempt from taxes. |
tax_subtotal | float | Subtotal tax. |
taxes | object | The data of the applicable taxes. |
notes | string | Customer’s notes about the order. |
details | string | Administrator’s notes about the order. |
s_address | string | Shipping address (the first field). |
s_address_2 | string | Shipping address (the second field). |
s_city | string | City (shipping address). |
s_country | string | A 2-letter country code (shipping address). |
s_country_descr | string | Country name (shipping address). |
s_firstname | string | First name (shipping address). |
s_lastname | string | Last name (shipping address). |
s_phone | string | Phone number (shipping address). |
s_state | string | State code (shipping address). |
s_state_descr | string | State name (shipping address). |
s_zipcode | string | Zip code (shipping address). |
b_address | string | Billing address (the first field). |
b_address_2 | string | Billing address (the second field). |
b_city | string | City (billing address). |
b_country | string | A 2-letter country code (billing address). |
b_country_descr | string | Country name (billing address). |
b_firstname | string | First name (billing address). |
b_lastname | string | Last name (billing address). |
b_phone | string | Phone number (billing address). |
b_state | string | State code (billing address). |
b_state_descr | string | State name (billing address). |
b_zipcode | string | Zip code (billing address). |
Update order-status
To update the status of an order send a PUT-request to /orders/<order_id>
and provide details in request-body
sh
PUT /orders/100
By default, when you change the order status via REST API, no email notifications are sent. However, you can use additional fields when updating an order, with 0 or 1 as values:
- notify_user—this flag determines whether or not to send the notification to the customer.
Example JSON-Body: Change Status & Notify by Email
{
"status": "P",
"notify_user": "1"
}
Example JSON-Body: Change Status & Dont notify by Email
{
"status": "P",
"notify_user": "0"
}
This request sets the status of the order to P
(Processed) and sends a email notification to the customer.
Response Format
The order has been updated successfully: HTTP/1.1 200 OK and the order ID:
{ "order_id": "98" }
The order couldn’t be updated: HTTP/1.1 400 Bad Request.
The order doesn’t exist: HTTP/1.1 404 Not Found.
Add filterable reference to order preview/ v.1.03.0
To add a individual ID to an order send a PUT-request to /orders/<order_id>
and provide following details in request-body
sh
PUT /orders/98
json
{
"vendor_ref":"ABC1234"
}
WARNING
"vendor_ref" only accepts a single string. Objects or arrays will not be added to the order.
Response Format
The order has been updated successfully: HTTP/1.1 200 OK and the order ID:
{ "order_id": "98" }
The order couldn’t be updated: HTTP/1.1 400 Bad Request.
The order doesn’t exist: HTTP/1.1 404 Not Found.
Get list of detailed orders matching "vendor_ref"
To send a GET-request to /orders/search
and provide "vendor_ref" details in request-url
Example
sh
GET /orders/search/?vendor_ref=ABC1234
Response Format
- The search has been successfully: HTTP/1.1 200 OK and a list of detailed orders
- No results where found: HTTP/1.1 404 Not found and message "Your search did not return any results".
- Request failed: HTTP/1.1 400 Bad request .