Orders
An Order can be created from a Cart, usually after a checkout process has been completed.
Representations
Representations are JSON objects submitted or received as payload to API requests or responses.
Order
id String | Unique identifier of the Order. |
version Int | Current version of the Order. |
orderNumber String | User-defined identifier of the Order that is unique across a Project. |
purchaseOrderNumber String | User-defined identifier of a purchase Order. It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow. |
customerId String |
|
customerEmail String | Email address of the Customer that the Order belongs to. |
customerGroup | Reference to the Customer Group of the Customer that the Order belongs to. Used for Line Item price selection. |
anonymousId String | Anonymous session associated with the Order. |
businessUnit | Reference to a Business Unit the Order belongs to. |
store | Reference to a Store the Order belongs to. |
lineItems Array of LineItem | Line Items that are part of the Order. |
customLineItems Array of CustomLineItem | Custom Line Items that are part of the Order. |
totalPrice | Sum of the Taxes are included if TaxRate |
taxedPrice |
If a discount applies on |
taxedShippingPrice | Sum of the |
discountOnTotalPrice | Discounts that apply on the total price of the Order. |
taxMode | Indicates how Tax Rates are set. Default:Platform |
taxRoundingMode | Indicates how monetary values are rounded when calculating taxes for HalfEven |
taxCalculationMode | Indicates how taxes are calculated when calculating taxes for LineItemLevel |
inventoryMode | Indicates how stock quantities are tracked for Line Items in the Order. Default:None |
billingAddress | Billing address associated with the Order. |
shippingAddress | Shipping address associated with the Order. Determines eligible ShippingMethod rates and Tax Rates of Line Items. |
shippingMode | Indicates whether there can be one or multiple Shipping Methods. Default:Single |
shippingKey String |
|
shippingInfo | Shipping-related information for |
shippingRateInput | Input used to select a ShippingRatePriceTier.
The data type of this field depends on the
|
shippingCustomFields | Custom Fields of the Shipping Method for |
shipping Array of Shipping | Shipping-related information for |
itemShippingAddresses Array of Address | Additional shipping addresses of the Order as specified by LineItems using the |
discountCodes Array of DiscountCodeInfo | Discount Codes added to the Order.
An Order that has |
directDiscounts Array of DirectDiscount | Direct Discounts added to the Order.
An Order that has |
refusedGifts Array of CartDiscountReference | Automatically set when a Line Item with |
paymentInfo | Payment information related to the Order. |
country | Used for Line Item price selection. Pattern:^[A-Z]{2}$ |
locale | Languages of the Order. Can only contain languages supported by the Project. |
origin | Indicates the origin of the Cart from which the Order was created. Default:Customer |
cart | Reference to the Cart for an Order created from Cart.
The referenced Cart will have the |
quote | Reference to the Quote for an Order created from Quote. |
orderState | Current status of the Order. |
shipmentState | Shipment status of the Order. |
paymentState | Payment status of the Order. |
state | State of the Order. This reference can point to a State in a custom workflow. |
syncInfo Array of SyncInfo | Contains synchronization activity information of the Order (like export or import). Can only be set with Update SyncInfo update action. |
returnInfo Array of ReturnInfo | Contains information regarding the returns associated with the Order. |
completedAt | User-defined date and time (UTC) of the Order. Present only on an Order created using Order Import. |
custom | Custom Fields of the Order. |
createdAt | Date and time (UTC) the Order was initially created. |
createdBy BETA | IDs and references that created the Order. |
lastModifiedAt | Date and time (UTC) the Order was last updated. |
lastModifiedBy BETA | IDs and references that last modified the Order. |
OrderFromCartDraft
version Int |
|
cart | ResourceIdentifier to the Cart from which the Order is created. This field is required, but is marked as optional for backwards compatibility reasons. |
orderNumber String | User-defined identifier for the Order that is unique across a Project. Once set, the value cannot be changed. |
purchaseOrderNumber String | User-defined identifier for a purchase Order. It is typically set by the Buyer and can be used with Quotes to track the purchase Order during the quote and order flow. |
paymentState | Payment status for the Order. |
shipmentState | Shipment status for the Order. |
orderState | Current status for the Order. Default:Open |
state | State for the Order in a custom workflow. |
custom | Custom Fields for the Order. The Custom Fields' type must match the Custom Fields' type in the referenced Cart. |
OrderFromQuoteDraft
version Int |
|
quote | ResourceIdentifier to the Quote from which the Order is created.
If the referenced Quote has expired ( |
quoteStateToAccepted Boolean | If false |
orderNumber String | User-defined identifier for the Order that is unique across a Project. Once set, the value cannot be changed. |
paymentState | Payment status for the Order. |
shipmentState | Shipment status for the Order. |
orderState | Current status for the Order. Default:Open |
state | State of the Order in a custom workflow. |
OrderPagedQueryResponse
PagedQueryResult with results
containing an array of Order.
limit Int | Number of results requested. |
offset Int | Number of elements skipped. |
count Int | Actual number of results returned. |
total Int | Total number of results matching the query.
This number is an estimation that is not strongly consistent.
This field is returned by default.
For improved performance, calculating this field can be deactivated by using the query parameter |
results Array of Order | Orders matching the query. |
OrderReference
id String | Unique identifier of the referenced Order. |
typeId | "order" References an Order. |
obj | Contains the representation of the expanded Order. Only present in responses to requests with Reference Expansion for Orders. |
OrderState
Indicates the state of the Order.
Open
The default state of a new Order.
Confirmed
Indicates that the Order is accepted and being processed.
Complete
Indicates that the Order is fulfilled.
Cancelled
Indicates that the Order is canceled.
ShipmentState
Indicates the shipment status of the Order.
Shipped
Indicates that the Order is shipped.
Delivered
Indicates that the Order is delivered.
Ready
Indicates that the Order is ready to be shipped.
Pending
Indicates that the shipment of the Order is pending.
Delayed
Indicates that the shipment of the Order is delayed.
Partial
Indicates that items in the Order are shipped in more than one shipment.
Backorder
Indicates that items in the Order are not in stock and will be delivered once the items are restocked.
PaymentState
Indicates the payment status for the Order.
BalanceDue
Indicates that payment balance is due for the Order.
Failed
Indicates that payment for the Order has failed.
Pending
Indicates that payment for the Order is pending.
CreditOwed
Indicates that payment for the Order is made on a credit basis.
Paid
Indicates that the Order is paid for.
PaymentInfo
payments Array of PaymentReference | References to the Payments associated with the Order. |
SyncInfo
Contains synchronization activity information of the Order (like export or import).
externalId String | Identifier of an external order instance, file, or other resource. |
channel | Connection to a synchronization destination. |
syncedAt | Date and time (UTC) the information was synced. |
Delivery
Contains information on how items are shipped to Customers, for example, a delivery note.
id String | Unique identifier of the Delivery. |
key String | User-defined unique identifier of the Delivery. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
items Array of DeliveryItem | Line Items or Custom Line Items that are delivered. |
parcels Array of Parcel | Information regarding the appearance, content, and shipment of a Parcel. |
address | Address to which Parcels are delivered. |
custom | Custom Fields of the Delivery. |
createdAt | Date and time (UTC) the Delivery was created. |
DeliveryDraft
key String | User-defined unique identifier of the Delivery. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
items Array of DeliveryItem | Line Items or Custom Line Items to deliver. It can also be specified individually for each Parcel. |
parcels Array of ParcelDraft | Information regarding the appearance, content, and shipment of a parcel. |
address | Address to which the Parcels are delivered. |
custom | Custom Fields for the Delivery. |
DeliveryItem
id String |
|
quantity Int | Number of Line Items or Custom Line Items delivered. |
Parcel
Information regarding the appearance, content, and shipment of a Parcel.
id String | Unique identifier of the Parcel. |
key String | User-defined unique identifier of the Parcel. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
measurements | Information about the dimensions of the Parcel. |
trackingData | Shipment tracking information of the Parcel. |
items Array of DeliveryItem | Line Items or Custom Line Items delivered in this Parcel. |
custom | Custom Fields of the Parcel. |
createdAt | Date and time (UTC) the Parcel was created. |
ParcelDraft
key String | User-defined unique identifier of the Parcel. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
measurements | Information about the dimensions for the Parcel. |
trackingData | Shipment tracking information for the Parcel. |
items Array of DeliveryItem | Line Items or Custom Line Items delivered in this Parcel. |
custom | Custom Fields for the Parcel. |
ParcelMeasurements
heightInMillimeter Int | Height of the Parcel. |
lengthInMillimeter Int | Length of the Parcel. |
widthInMillimeter Int | Width of the Parcel. |
weightInGram Int | Weight of the Parcel. |
TrackingData
Information that helps track a Parcel.
trackingId String | Identifier to track the Parcel. |
carrier String | Name of the carrier that delivers the Parcel. |
provider String | Name of the provider that serves as facade to several carriers. |
providerTransaction String | Transaction identifier with the |
isReturn Boolean |
false |
Returns
The following types contain representations of returns, including what items are being returned and their current payment and shipment states.
ReturnInfo
Stores information about returns connected to an Order.
items Array of ReturnItem | Information on the Line Items or Custom Line Items returned. |
returnTrackingId String | User-defined identifier to track the return. |
returnDate | Date and time (UTC) the return is initiated. |
ReturnInfoDraft
items Array of ReturnItemDraft | Information on the Line Items or Custom Line Items returned. |
returnTrackingId String | User-defined identifier for tracking the return. |
returnDate | Date and time (UTC) the return is initiated. |
ReturnItem
Information on the returned Line Items or Custom Line Items; see LineItemReturnItem or CustomLineItemReturnItem respectively.
LineItemReturnItem
id String | Unique identifier of the Return Item. |
key String | User-defined unique identifier of the LineItemReturnItem. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
quantity Int | Number of Line Items returned. |
type String | "LineItemReturnItem" |
comment String | User-defined description for the return. |
shipmentState | Shipment status of the Return Item. |
paymentState | Payment status of the Return Item:
|
lineItemId String |
|
custom | Custom Fields of the Return Item. |
createdAt | Date and time (UTC) the Return Item was intitially created. |
lastModifiedAt | Date and time (UTC) the Return Item was last updated. |
CustomLineItemReturnItem
id String | Unique identifier of the Return Item. |
key String | User-defined unique identifier of the CustomLineItemReturnItem. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
quantity Int | Number of Custom Line Items returned. |
type String | "CustomLineItemReturnItem" |
comment String | User-defined description for the return. |
shipmentState | Shipment status of the Return Item. |
paymentState | Payment status of the Return Item:
|
customLineItemId String |
|
custom | Custom Fields of the Return Item. |
createdAt | Date and time (UTC) the Return Item was intitially created. |
lastModifiedAt | Date and time (UTC) the Return Item was last updated. |
ReturnItemDraft
key String | User-defined unique identifier of the Return Item. MinLength:2 MaxLength: 256 Pattern: ^[a-zA-Z0-9_-] |
quantity Int | Number of Line Items or Custom Line Items to return. |
lineItemId String |
Required if Line Items are returned, to create a LineItemReturnItem. |
customLineItemId String |
Required if Custom Line Items are returned, to create a CustomLineItemReturnItem. |
comment String | User-defined description for the return. |
shipmentState | Shipment status of the item to be returned.
Can either be |
custom | Custom Fields for the Return Item. |
ReturnShipmentState
Advised
Initial state for Return Items that are non-refundable.
Return Items of this state will have the
NonRefundable
ReturnPaymentState.Returned
Initial state for Return Items that are refundable.
Return Items of this state will have the
Initial
ReturnPaymentState.BackInStock
A state indicating that the Return Items are restocked in inventory.
Unusable
A state indicating that the Return Items are not in good condition and cannot be restocked.
Allowed state transitions:
ReturnPaymentState
NonRefundable
Initial state for Return Items for which payment cannot be refunded.
Return Items have the
Advised
ReturnShipmentState.Initial
Initial state for Return Items for which payment can be refunded.
Return Items have the
Returned
ReturnShipmentState.Refunded
The payment for the Return Items is refunded.
NotRefunded
The payment for the Return Items is not refunded.
Allowed state transitions:
Get Order
by ID
by Order Number
view_orders:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/orders/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}
Get Order in Store
by ID
by Order Number
If the Order exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a ResourceNotFound error.
view_orders:{projectKey}
view_orders:{projectKey}:{storeKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
id String |
|
expand | The parameter can be passed multiple times. |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/orders/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}
Query Orders
To perform searches across a large number of Orders for back-office use cases, consider Order Search BETA instead.
view_orders:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
where | The parameter can be passed multiple times. |
/^var[.][a-zA-Z0-9]+$/ Any string parameter matching this regular expression | Predicate parameter values. The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limit Int | Number of results requested. |
offset Int | Number of elements skipped. |
withTotal Boolean | Controls the calculation of the total number of query results. Set to Default: true |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/orders -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"limit": 20,"offset": 0,"count": 1,"total": 1,"results": [{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}]}
Query Orders in Store
view_orders:{projectKey}
view_orders:{projectKey}:{storeKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
where | The parameter can be passed multiple times. |
/^var[.][a-zA-Z0-9]+$/ Any string parameter matching this regular expression | Predicate parameter values. The parameter can be passed multiple times. |
sort | The parameter can be passed multiple times. |
expand | The parameter can be passed multiple times. |
limit Int | Number of results requested. |
offset Int | Number of elements skipped. |
withTotal Boolean | Controls the calculation of the total number of query results. Set to Default: true |
application/json
curl --get https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/orders -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"limit": 20,"offset": 0,"count": 1,"total": 1,"results": [{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}]}
Check if Order exists
by ID
by Order Number
by Query Predicate
Checks if an Order exists for a given id
. Returns a 200 OK
status if the Order exists or a 404 Not Found
otherwise.
view_orders:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/orders/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
Check if Order exists in Store
by ID
by Order Number
by Query Predicate
Checks if an Order exists for a given id
. Returns a 200 OK
status if the Order exists or a ResourceNotFound error otherwise.
view_orders:{projectKey}
view_orders:{projectKey}:{storeKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
id String |
|
curl --head https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/orders/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
Create Order
from Cart
from Quote
by Import
Before you create an Order, the Cart must have a shipping address set.
The shipping address is used for tax calculation for a Cart with Platform
TaxMode.
Creating an Order produces the OrderCreated Message.
If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number.
Specific Error Codes:
manage_orders:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
expand | The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/orders -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"cart" : {"id" : "7c2e2694-aefe-43d7-888e-6a99514caaca","typeId" : "cart"},"version" : 10}DATA
{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}
Create Order in Store
from Cart
from Quote
Before you create an Order, the Cart must have a shipping address set.
The shipping address is used for tax calculation for a Cart with Platform
TaxMode.
Creating an Order produces the OrderCreated Message. If a server-side problem occurs, indicated by a 500 Internal Server Error HTTP response, the Order creation may still successfully complete after the error is returned. If you receive this error, you should verify the status of the Order by querying a unique identifier supplied during the creation request, such as the Order number.
Specific Error Codes:
manage_orders:{projectKey}
manage_orders:{projectKey}:{storeKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
expand | The parameter can be passed multiple times. |
application/json
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/orders -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"cart" : {"id" : "7c2e2694-aefe-43d7-888e-6a99514caaca","typeId" : "cart"},"version" : 10}DATA
{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}
Update Order
by ID
by Order Number
manage_orders:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
expand | The parameter can be passed multiple times. |
application/json
version Int | Expected version of the Order on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions Array of OrderUpdateAction | Update actions to be performed on the Order. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/orders/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 1,"actions" : [ {"action" : "changeOrderState","orderState" : "Complete"} ]}DATA
{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}
Update Order in Store
by ID
by Order Number
If the Order exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a ResourceNotFound error.
manage_orders:{projectKey}
manage_orders:{projectKey}:{storeKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
id String |
|
expand | The parameter can be passed multiple times. |
application/json
version Int | Expected version of the Order on which the changes should be applied. If the expected version does not match the actual version, a ConcurrentModification error will be returned. |
actions Array of OrderUpdateAction | Update actions to be performed on the Order. |
application/json
curl https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/orders/{id} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}' \--header 'Content-Type: application/json' \--data-binary @- << DATA{"version" : 1,"actions" : [ {"action" : "changeOrderState","orderState" : "Complete"} ]}DATA
{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}
Delete Order
by ID
by Order Number
Only Orders created for testing must be deleted.
If a DiscountCode with a maxApplications
or maxApplicationsPerCustomer
limit has been applied to the Order, the deleted Order is still counted towards that limit.
Deleting an Order produces the OrderDeleted Message.
manage_orders:{projectKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
id String |
|
version Int | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
dataErasure Boolean | To erase all related personal data in compliance with GDPR, set to Default: false |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/orders/{id}?version={version} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}
Delete Order in Store
by ID
by Order Number
Only Orders created for testing must be deleted.
If a DiscountCode with a maxApplications
or maxApplicationsPerCustomer
limit has been applied to the Order, the deleted Order is still counted towards that limit.
If the Order exists in the Project but does not have a store
specified, or the store
field references a different Store, this method returns a ResourceNotFound error.
Deleting an Order produces the OrderDeleted Message.
manage_orders:{projectKey}
manage_orders:{projectKey}:{storeKey}
region String | Region in which the Project is hosted. |
projectKey String |
|
storeKey String |
|
id String |
|
version Int | Last seen version of the resource. |
expand | The parameter can be passed multiple times. |
dataErasure Boolean | To erase all related personal data in compliance with GDPR, set to Default: false |
application/json
curl -X DELETE https://api.{region}.commercetools.com/{projectKey}/in-store/key={storeKey}/orders/{id}?version={version} -i \--header 'Authorization: Bearer ${BEARER_TOKEN}'
{"type": "Order","id": "92f5a867-bf19-47ab-982c-6720a03a3921","version": 1,"createdAt": "2017-01-04T19:54:49.797Z","lastModifiedAt": "2017-01-04T19:54:49.797Z","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"orderState": "Open","syncInfo": [],"returnInfo": [],"refusedGifts": [],"taxMode": "External","inventoryMode": "None","taxRoundingMode": "HalfEven","customerId": "7297c742-d8b0-484b-aadc-1d0ba6769dc9","businessUnit": {"typeId": "business-unit","key": "ba-france-123"},"lineItems": [{"id": "7297c742-d8b0-484b-aadc-1d0ba1869dc9","productId": "c5c75935-595a-4cc3-a80e-24e9a9c55094","name": {"en": "MyProduct"},"productType": {"typeId": "product-type","id": "a5c7e173-9754-4f02-9b18-a600896ae0e1","version": 21},"productSlug": {"de": "neues-produkt-slug-1234678","en": "new-product-slug-12345678"},"variant": {"id": 1,"sku": "some-sku-123","prices": [{"value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"id": "6d36dc85-6131-495d-9f20-d00f411d4124"}],"images": [],"attributes": [{"name": "text","value": "attribute-value"},{"name": "enum","value": {"key": "test","label": "test"}}],"assets": []},"price": {"id": "6d36dc85-6131-495d-9f20-d00f411d4124","value": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000}},"quantity": 1,"discountedPricePerQuantity": [],"taxRate": {"name": "Bla","amount": 0.1,"includedInPrice": false,"country": "DE","subRates": []},"state": [{"quantity": 1,"state": {"typeId": "state","id": "7c2e2694-aefe-43d7-888e-6a99514caaca"}}],"priceMode": "Platform","lineItemMode": "Standard","totalPrice": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"taxedPrice": {"totalNet": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1000},"totalGross": {"type": "centPrecision","fractionDigits": 2,"currencyCode": "EUR","centAmount": 1100},"taxPortions": [{"rate": 0.1,"amount": {"type": "centPrecision","currencyCode": "EUR","centAmount": 634,"fractionDigits": 2},"name": "Bla"}]},"perMethodTaxRate": [],"taxedPricePortions": []}],"customLineItems": [],"discountCodes": [],"origin": "Customer","shipping": [],"shippingMode": "Single"}