Orders
A comprehensive list of the order resource's fields and attributes
Commerce Layer Metrics API lets you perform different types queries on the /orders/{{query_type}}
endpoint to gather stats and information about your organization order history:
The results of each query can be filtered based on specific fields and operators:
FiltersYou can easily see it in action by checking these simple examples:
ExamplesCommerce Layer Metrics API Orders collection includes real orders only, meaning orders whose lifecycle starts from placement (i.e. placed, approved, or cancelled orders). If you need to do statistics on orders that are not placed yet (i.e. draft or pending orders), please refer to the Carts collection documentation.
Fields and attributes
Please reference to this list for a comprehensive view of all the order resource's fields and attributes, accessible through the Metrics API:
billing_address
field
billing_address
fieldAttribute | Type | Description |
---|---|---|
| Boolean | Indicates if the address is a business or a personal one. |
| String | The city specified in the address. |
| String | The international 2-letter country code (as defined by the ISO 3166-1 standard) specified in the address. |
| Boolean | Indicates if the address has been successfully geocoded. |
| Boolean | Indicates if the latitude and longitude of the address are present, either geocoded or manually updated. |
| String | The state, province or region code specified in the address. |
| String | The ZIP or postal code specified in the address. |
| String | The company specified in the address. |
| String | The first name specified in the address. |
| String | The last name specified in the address. |
customer
field
customer
fieldAttribute | Type | Description |
---|---|---|
| String | The ID of the customer. |
| String | The email address of the customer. |
| String | The name of the customer group the customer belongs to (if any). |
line_items
field
line_items
fieldAttribute | Type | Description |
---|---|---|
| String | The code of the associated SKU or bundle. |
| Number | The discount applied to the line item (float). |
| String | The ID of the line item. |
| String | The ID of the associated item. |
| String | The type of the associated item. One of |
| String | The name of the line item. When missing, it gets populated with the name of the associated item (if present). |
| Number | The amount of the line item option (float). |
| Integer | The line item's quantity. |
| Number | The collected tax amount for the line item (float). Otherwise calculated as the line item's |
| Number | The tax rate for the line item (if calculated). |
| Number | The total amount of the line item (float). Calculated as the line item's |
| Number | The unit amount of the line item (float). |
| String | The date and time at which the line item was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| Object | The line item options (see the related table for all the single option objects attributes). |
Line item options
field
options
fieldAttribute | Type | Description |
---|---|---|
| String | The ID of the line item option. |
| String | The name of the line item option. When missing, it gets populated with the name of the associated SKU option. |
| Integer | The line item option's quantity. |
| Number | The total amount of the line item option (float). Calculated as the line item option's |
| Number | The unit amount of the line item option (float). |
market
field
market
fieldAttribute | Type | Description |
---|---|---|
| String | The ID of the market. |
| String | The name of the market. |
| Integer | The numeric unique identifier for the market. |
order
field
order
fieldAttribute | Type | Description |
---|---|---|
| String | The lower limit of the date and time range used to filter the collected orders (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The upper limit of the date and time range used to filter the collected orders (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date field (e.g. |
| Boolean | Indicates a discount has been applied to the order. |
| Boolean | Indicates if the order has been partially or totally refunded. |
| Boolean | Indicates if a gift card has been (or is set to be) used to pay — in total or in part - for the order. |
| Boolean | Indicates if a coupon code has been (or is set to be) used to pay — in total or in part — for the order. |
| Boolean | Indicates if a return is associated with the order. |
| Boolean | Indicates if at least one line item of the order has at least an option. |
| Number | The sum of all the adjustments applied to the order (float). |
| Number | The taxes applied to the order's adjustments (float). |
| Number | The order's adjustment taxable amount (float). |
| String | The date and time at which the order was approved (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the order was archived (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| Boolean | Indicates if the order has been archived. |
| String | The date and time at which the order was cancelled (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The international 2-letter country code (as defined by the ISO 3166-1 standard), automatically inherited from the order's shipping address. |
| String | The coupon code to be used to pay — in total or in part — for the order. If valid, it triggers a promotion adding a discount line item to the order. |
| String | The date and time at which the order was created (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The international 3-letter currency code (as defined by the ISO 4217 standard), automatically inherited from the order's market. |
| Number | The sum of all the discounts applied to the order (float). |
| Number | The duty amount that is calculated by external services (float). |
| Boolean | Indicates if taxes are applied to shipping costs. |
| String | The order's fulfillment status. One of |
| String | The date and time at which the order's fulfillment status was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The gift card code (at least the first 8 characters) to be used to pay — in total or in part — for the order. If valid, it uses the associated gift card balance. |
| Number | The sum of all the gift cards applied to the order (float). |
| Boolean | Indicates if the order has been placed as guest (by a non-logged in customer). |
| String | The ID of the order. |
| String | The preferred language code (as defined by the ISO 639-1 standard) to be used when communicating with the customer when checking out the order. |
| Integer | The total number of line item options associated with the order's line items. |
| Integer | The numeric unique identifier for the order. |
| Number | The costs of the payment method associated with the order (float). |
| Number | The taxes applied to the order's payment method costs (float). |
| Number | The order's payment method taxable amount (float). |
| String | The order's payment status. One of |
| String | The date and time at which the order's payment status was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the order was placed (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | Any external identifier that might be useful to link the order resource to other systems through the Commerce Layer core API. |
| String | Any identifier of the 3rd-party system that defines the reference code. |
| Integer | The total number of shipments associated with the order. |
| Number | The sum of all the shipping costs of the order (float). |
| Number | The order's shipping taxable amount (float). |
| Integer | The total number of SKUs in the order's line items. |
| String | The order status. One of |
| Number | The sum of all the SKU line items total amounts (float). |
| Number | The taxes applied to the order's subtotal (float). |
| Number | The order's subtotal taxable amount (float). |
| Boolean | Indicates if taxes are included in the order amounts (automatically inherited from the order's price list). |
| Number | The order's total amount (float). |
| Number | The order's total amount, taxes included (float). |
| Number | The sum of all the taxes applied to the order (float). |
| Number | The order's total taxable amount (float). |
| String | The date and time at which the order was last updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time of the order's latest status change, regardless of the order's status (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| Integer | The difference in seconds between |
| Integer | The difference in seconds between |
| Integer | The difference in seconds between |
| Integer | The day of week when the order was placed, expressed as an integer ( |
| Integer | Total amount of refunds (including taxes) associated with the order. |
| Number | The total amount of the order minus the total amount of refunds. |
| String | Searchable field containing all orders data. |
payment_method
field
payment_method
fieldAttribute | Type | Description |
---|---|---|
| String | The ID of the payment method. |
| String | The payment source type. One of |
| String | The payment source type, titleized. |
| Boolean | Indicates if the payment has been marked as MOTO (must be supported by the payment gateway). |
| String | The payment method's issuer (if present and provided by the payment gateway). |
| String | The type of issuer (if present and provided by the payment gateway). |
| String | The type of card used to pay for the order (if present and provided by the payment gateway). |
refunds
field
refunds
fieldAttribute | Type | Description |
---|---|---|
| String | The ID of the refund. |
| Number | The refunded amount (float). |
| String | The transaction number associated with the refund (auto-generated). |
shipping_address
field
shipping_address
fieldAttribute | Type | Description |
---|---|---|
| Boolean | Indicates if the address is a business or a personal one. |
| String | The city specified in the address. |
| String | The international 2-letter country code (as defined by the ISO 3166-1 standard) specified in the address. |
| Boolean | Indicates if the address has been successfully geocoded. |
| Boolean | Indicates if the latitude and longitude of the address are present, either geocoded or manually updated. |
| String | The state, province or region code specified in the address. |
| String | The ZIP or postal code specified in the address. |
shipments
field
shipments
fieldAttribute | Type | Description |
---|---|---|
| String | The shipment ID. |
| String | The shipment number. |
| String | The shipment status. |
| String | The date and time at which the shipment status was cancelled (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the shipment status was put on hold (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the shipment was picked (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the shipment was packed (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the shipment was ready to ship (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the shipment was shipped (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the shipment was created (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | The date and time at which the shipment was updated (complete date plus hours, minutes and seconds — according to the ISO 8601 standard). |
| String | Any external identifier that might be useful to link the shipment resource to other systems through the Commerce Layer core API. |
| String | Any identifier of the 3rd-party system that defines the reference code. |
| Integer | The difference in seconds between |
| Integer | The difference in seconds between |
Shipment stock_location
field
stock_location
fieldAttribute | Type | Description |
---|---|---|
| String | The shipment stock location ID. |
| String | The shipment stock location name. |
| String | Any external identifier that might be useful to link the stock location reference resource to other systems through the Commerce Layer core API. |
| String | Any identifier of the 3rd-party system that defines the reference code. |
Shipment shipping_method
field
shipping_method
fieldAttribute | Type | Description |
---|---|---|
| String | The shipment shipping method ID. |
| String | The shipment shipping method name. |
| String | Any external identifier that might be useful to link the shipping method reference resource to other systems through the Commerce Layer core API. |
| String | Any identifier of the 3rd-party system that defines the reference code. |
| String | The international 3-letter currency code (as defined by the ISO 4217 standard), automatically inherited from the order's market. |
Shipment shipping_category
field
shipping_category
fieldAttribute | Type | Description |
---|---|---|
| String | The shipment shipping category ID. |
| String | The shipment shipping category name. |
| String | Any external identifier that might be useful to link the shipping method reference resource to other systems through the Commerce Layer core API. |
| String | Any identifier of the 3rd-party system that defines the reference code. |
Shipment tags
field
tags
fieldAttribute | Type | Description |
---|---|---|
| String | The tag ID. |
| String | The tag name. |
tags
field
tags
fieldAttribute | Type | Description |
---|---|---|
| String | The tag ID. |
| String | The tag name. |
Last updated