List orders
const url = 'https://api.ebitex.io/commerce/management/v1/orders';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.ebitex.io/commerce/management/v1/orders \ --header 'Authorization: Bearer <token>'Lists the organization’s orders, newest first, 50 to a page, as a fulfilment system needs them: the order’s number (ORD-1001), storeId and storeName, status, isTest, the money, placedUtc and paidUtc, each line with its id, and each shipment with its id and externalReference. Filter with storeId, status, number (ORD-1001 or 1001; without storeId it can match one order in each store, so the answer is a list), hideTest=true (drop test orders, which a fulfilment system must not ship), and paidFrom / paidTo (a date and time). Ask for the next page with page.
No answer carries who bought: no name, email, address, postal code or country.
Call it from your own server with a management key (the Management keys section of Commerce’s delivery keys screen); it has no CORS policy, so a browser page cannot use it. The key belongs to the organization and works on every store’s orders. It has two tiers: commerce.management.read reads orders, finds a shipment by its carrier reference and reads an order’s fulfilment; commerce.orders.fulfil does all of that and also records and updates shipments. Neither can refund, cancel, move an order along, change stock, or read who bought: no answer carries a buyer’s name, email or address. The key’s budget is 300 requests a minute.
Key: a Commerce management key with commerce.management.read or commerce.orders.fulfil.
Authorizations
Section titled “Authorizations”Responses
Section titled “ Responses ”{ "items": [ … ], "page": 1, "pageSize": 50, "total": 120 }. total is the number of orders that match, across all pages.
validation_failed: status, storeId, number, paidFrom or paidTo is not a value the list accepts.
missing_api_key or invalid_api_key: no key was sent, or it is unknown, revoked or expired.
payment_required: the organization’s subscription needs attention.
scope_denied: the key lacks commerce.orders.fulfil. app_not_available: Commerce is not enabled for the organization. ip_denied: the key was used from an address outside its restrictions.
rate_limited: the key spent its 300 requests a minute; Retry-After says how long to wait. too_many_failed_authentications: too many bad keys from this address.