Skip to content
On this page

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:

ParameterDefault valueDescription
page1The 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_page10Determines the number of orders on a page.
sort_bydateDetermines the parameter by which the orders are sorted in the response.
sort_orderdescDetermines the sorting order:asc—ascendingdesc—descending
statusP - processed
C -complete
O -open
F - failed
D - declined
B - backordered
I - cancelled
H - Return complete
G - Return in progress
N - Incomplete
user_idSearches only for the orders placed by the customer with the specified ID.
emailSearches only for the orders placed by the customer with the specified email.
invoice_idSearches only for the orders with the specified invoice ID.
updated_at_from updated_at_toSearches only for the orders last modified during the specified date period.

Order status explained

StatusDescriptionBackend-Description
CComplete - all work on the order was completedKomplett (Versand abgeschlossen)
PProcessed - the payment was received - ready to shipBezahlt und bereit zum Versand (P)
OOpen - the order was placed and created in the store database, but it hasn’t been processed yetOffen - Noch nicht bezahlt
Fthe payment transaction failedFehlgeschlagen
DDeclined - the order was canceled by the store administrator.Abgelehnt (Storniert vom Händler)
ICanceled - the order was canceled by the customer.Storniert
GReturn request from customer in progress.Retoure in bearbeitung
HReturn is processed and repaidRetourniert
Bthe order hasn’t been processed yet, as it contains out-of-stock items.Zurückgestellt / Retoure in bearbeitung
NIncomplete (see below).Unvollständig
EUnpaid - The Customer got a notification with inctructions how to make the payment for his orderNoch 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.

FieldValuesDescription
order_idintegerA unique identifier of the order.
statusstringThe status of the order. A unique letter of the English alphabet is assigned to every order status as a means to refer to it.
timestampintegerThe https://en.wikipedia.org/wiki/Unix_time when the order was placed.
company_idintegerID of the associated company
issuer_idintegerID of the administrator who created the order via the admin panel.
user_idintegerA unique identifier of the user who placed the order. Orders placed by guests have user_id=0.
firstnamestringCustomer’s first name.
lastnamestringCustomer’s last name.
emailstringCustomer’s email.
phonestringCustomer’s phone number.
lang_codestringThe code of the language which the customer selected when placing the order, for example en.
totalfloatThe sum to be paid by the customer.
discountfloatTotal discount.
subtotalfloatThe order subtotal.
subtotal_discountfloatDiscount on the order subtotal.
display_subtotalfloatThe subtotal that will be displayed.
invoice_idintegerID of the invoice.
credit_memo_idintegerID of the credit memo.
payment_idintegerID of the payment method.
payment_infoarrayPayment information.
payment_methodobject
payment_surchargefloatThe amount of payment surcharge.
repaid0—no
1—yes
Defines if the order was repaid.
productsobjectThe information about the ordered products.
promotion_idsstringA string of promotion IDs separated by commas.
promotionsarrayThe data of applicable promotions.
need_shippingtrue falseDefines if the order requires shipping.
shipping_idsstringIDs of the shipping methods.
shippingarrayThe data of the shipping methods used in the order.
shipping_idintegerID of the shipping method.
need_shipmenttrue falseDefines if the order requires shipments.
shipment_idsstringA string of shipment IDs separated by commas.
shipping_costfloatThe shipping cost.
display_shipping_costfloatThe shipping cost that will be displayed.
tax_exemptY—yes N—noDetermines if the customer is exempt from taxes.
tax_subtotalfloatSubtotal tax.
taxesobjectThe data of the applicable taxes.
notesstringCustomer’s notes about the order.
detailsstringAdministrator’s notes about the order.
s_addressstringShipping address (the first field).
s_address_2stringShipping address (the second field).
s_citystringCity (shipping address).
s_countrystringA 2-letter country code (shipping address).
s_country_descrstringCountry name (shipping address).
s_firstnamestringFirst name (shipping address).
s_lastnamestringLast name (shipping address).
s_phonestringPhone number (shipping address).
s_statestringState code (shipping address).
s_state_descrstringState name (shipping address).
s_zipcodestringZip code (shipping address).
b_addressstringBilling address (the first field).
b_address_2stringBilling address (the second field).
b_citystringCity (billing address).
b_countrystringA 2-letter country code (billing address).
b_country_descrstringCountry name (billing address).
b_firstnamestringFirst name (billing address).
b_lastnamestringLast name (billing address).
b_phonestringPhone number (billing address).
b_statestringState code (billing address).
b_state_descrstringState name (billing address).
b_zipcodestringZip 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 .

Copyright © Ich hab ne Macke GmbH 2024