Orders

Prerequisites

Get Order by Order ID

Request

curl -D- -X GET <base_url>/api/v1/orders/<orderId> \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \

Response

{
  "id": "{id}",
  "orderNumber": "{orderNumber}",
  "orderStatus": {
    "id": "{id}",
    "name": "{orderStatusName}"
  },
  "createdDate": "{createdDate}",
  "completedDate": "{completedDate}",
  "cultureCode": "{cultureCode}",
  "discount": "{discountAmount | null}",
  "discountTotal": "{discountTotalAmount | null}",
  "note": "{note | null}",
  "orderTotal": "{orderTotalAmount}",
  "paymentTotal": "{paymentTotalAmount}",
  "shippingTotal": "{shippingTotalAmount}",
  "subTotal": "{subTotalAmount}",
  "tax": "{taxAmount}",
  "vat": "{vatAmount}",
  "store": {
    "id": "{storeId}",
    "name": "{storeName}",
    "description": "{storeDescription}"
  },
  "billingAddress": {
    "addressName": "{addressName}",
    "attention": "{attention}",
    "city": "{city}",
    "companyName": "{companyName}",
    "country": {
      "id": "{countryId}",
      "name": "{countryName}"
    },
    "emailAddress": "{emailAddress}",
    "firstName": "{firstName}",
    "id": "{id}",
    "lastName": "{lastName}",
    "line1": "{line1}",
    "line2": "{line2}",
    "mobilePhoneNumber": "{mobilePhoneNumber}",
    "phoneNumber": "{phoneNumber}",
    "postalCode": "{postalCode}",
    "state": "{state}"
  },
  "billingCurrency": {
    "id": "{currencyId}",
    "isoCode": "{isoCode}"
  },
  "customer": {
    "id": "{id}",
    "firstName": "{firstName}",
    "lastName": "{lastName}",
    "emailAddress": "{emailAddress}",
    "phoneNumber": "{phoneNumber}"
  },
  "customProperties": [],
  "orderProperties": [],
  "discounts": [],
  "orderLines": [
    {
      "id": "{id}",
      "sku": "{sku}",
      "productName": "{productName}",
      "price": "{priceAmount}",
      "quantity": "{quantityNumber}",
      "discount": "{discountAmount}",
      "tax": "{taxAmount}",
      "total": "{totalAmount}",
      "taxRate": "{taxRate}",
      "variantSku": "{variantSku | null}",
      "unitDiscount": "{unitDiscount | null}",
      "discounts": [],
      "orderLineProperties": []
    }
  ],
  "payments": [
    {
      "id": "{id}",
      "amount": "{amount}",
      "fee": "{fee}",
      "feePercentage": "{feePercentage}",
      "feeTotal": "{feeTotal}",
      "grossAmount": "{grossAmount | null}",
      "transactionId": "{transactionId}",
      "tax": "{tax | null}",
      "taxRate": "{taxRate | null}",
      "paymentMethod": {
        "id": "{id}",
        "name": "{paymentMethodName}",
        "description": "{description}",
        "displayName": "{displayName}",
        "feePercent": "{feePercent}",
        "fees": [
          {
            "amount": "{amount}",
            "priceGroupId": "{priceGroupId}"
          }
        ],
        "imageId": "{imageId | null}",
        "imageUrl": "{imageUrl | null}",
        "paymentMethodProperties": []
      }
    }
  ],
  "shipments": [
    {
      "id": "{id}",
      "shipmentDiscount": "{shipmentDiscount | null}",
      "shipmentName": "{shipmentName}",
      "shipmentPrice": "{shipmentPrice}",
      "shipmentPriceTotal": "{shipmentPriceTotal}",
      "tax": "{taxAmount}",
      "taxRate": "{taxRate}",
      "vat": "{vatAmount}",
      "vatRate": "{vatRate}",
      "trackAndTrace": "{trackAndTrace | null}",
      "deliveryNote": "{deliveryNote}",
      "shipmentAddress": {
        "addressName": "{addressName}",
        "attention": "{attention}",
        "city": "{city}",
        "companyName": "{companyName}",
        "country": {
          "id": "{countryId}",
          "name": "{countryName}"
        },
        "emailAddress": "{emailAddress}",
        "firstName": "{firstName}",
        "id": "{id}",
        "lastName": "{lastName}",
        "line1": "{line1}",
        "line2": "{line2}",
        "mobilePhoneNumber": "{mobilePhoneNumber}",
        "phoneNumber": "{phoneNumber}",
        "postalCode": "{postalCode}",
        "state": "{state}"
      },
      "shippingMethod": {
        "id": "{id}",
        "name": "{name}",
        "defaultPaymentMethod": "{defaultPaymentMethod | null}",
        "eligiblePaymentMethods": []
      },
      "orderLines": [
        {
          "id": "{id}",
          "sku": "{sku}",
          "productName": "{productName}",
          "price": "{priceAmount}",
          "quantity": "{quantityNumber}",
          "discount": "{discountAmount}",
          "tax": "{taxAmount}",
          "total": "{totalAmount}",
          "taxRate": "{taxRate}",
          "variantSku": "{variantSku | null}",
          "unitDiscount": "{unitDiscount | null}",
          "discounts": [],
          "orderLineProperties": []
        }
      ]
    }
  ],
  "additionalAddresses": "{additionalAddresses | null}"
}

Error Handling

Error
Description

BadRequest (400)

Execution of the pipeline fails; AccessToken was not attached.

Unauthorized (401)

The token is expired.

Forbidden (403)

The token does not have access to this endpoint.

NotFound (404)

Order not found.

Error Response Example

{
"errors": [
        {
            "error-description": "Order with the supplied id orderId was not found",
            "error": "NotFound"
        }
    ]
}

Get Order by Payment Guid

Request

// Some code
curl -D- -X GET <base_url>/api/v1/payments/<paymentGuid>/order \
    -H 'Authorization: Bearer <ACCESS_TOKEN>'
    -H 'Content-Type: application/json' \

Response

{
    "id": "{id}",
    "orderNumber": "{orderNumber}",
    "orderStatus": {
        "id": "{id}",
        "allowOrderEdit": "{true | false}",
        "allowUpdate": "{true | false}",
        "alwaysAvailable": "{true | false}",
        "externalId": "{externalId | null}",
        "name": "{orderName}",
        "nextOrderStatus": {
            "id": "{id}",
            "allowOrderEdit": "{true | false}",
            "allowUpdate": "{true | false}",
            "alwaysAvailable": "{true | false}",
            "externalId": "{externalId | null}",
            "name": "{orderName}",
            "nextOrderStatus": {
                "id": "{id}",
                "allowOrderEdit": "{true | false}",
                "allowUpdate": "{true | false}",
                "alwaysAvailable": "{true | false}",
                "externalId": "{externalId | null}",
                "name": "{orderName}",
                "nextOrderStatus": {
                    "id": "{id}",
                    "allowOrderEdit": "{true | false}",
                    "allowUpdate": "{true | false}",
                    "alwaysAvailable": "{true | false}",
                    "externalId": "{externalId | null}",
                    "name": "{orderName}",
                    "nextOrderStatus": "{nextOrderStatus | null}",
                    "pipeline": "{pipeline | null}",
                    "renderInMenu": "{true | false}",
                    "renderChildren": "{true | false}",
                    "sort": "{sortNumber}"
                },
                "pipeline": "{pipeline | null}",
                "renderInMenu": "{true | false}",
                "renderChildren": "{true | false}",
                "sort": "{sortNumber}"
            },
            "pipeline": "{pipeline | null}",
            "renderInMenu": "{true | false}",
            "renderChildren": "{true | false}",
            "sort": "{sortNumber}"
        },
        "pipeline": "{pipeline | null}",
        "renderInMenu": "{true | false}",
        "renderChildren": "{true | false}",
        "sort": "{sortNumber}"
    },
    "createdDate": "{createdDate}",
    "completedDate": "{completedDate}",
    "cultureCode": "{cultureCode}",
    "discount": "{discountAmount}",
    "discountTotal": "{discountTotalAmount}",
    "note": "{note | null}",
    "orderTotal": "{orderTotalAmount}",
    "paymentTotal": "{paymentTotalAmount}",
    "shippingTotal": "{shippingTotalAmount}",
    "subTotal": "{subTotalAmount}",
    "tax": "{taxAmount}",
    "billingAddress": {
        "addressName": "{addressName}",
        "attention": "{attention}",
        "city": "{city}",
        "companyName": "{companyName}",
        "country": {
            "cultureCode": "{cultureCode}",
            "id": "{countryId}",
            "name": "{countryName}"
        },
        "emailAddress": "{email}",
        "firstName": "{firstName}",
        "id": "{id}",
        "lastName": "{lastName}",
        "line1": "{addressLine1}",
        "line2": "{addressLine2}",
        "mobilePhoneNumber": "{mobilePhoneNumber}",
        "phoneNumber": "{phoneNumber}",
        "postalCode": "{postalCode}",
        "state": "{state}"
    },
    "billingCurrency": {
        "id": "{id}",
        "isoCode": "{isoCode}",
        "exchangeRate": "{exchangeRate}"
    },
    "customer": {
        "id": "{id}",
        "firstName": "{firstName}",
        "lastName": "{lastName}",
        "emailAddress": "{emailAddress}",
        "phoneNumber": "{phoneNumber}"
    },
    "store": {
        "id": "{id}",
        "name": "{name}",
        "description": "{description}"
    },
    "discounts": [],
    "orderLines": [
        {
            "id": "{id}",
            "sku": "{sku}",
            "productName": "{productName}",
            "price": "{priceAmount}",
            "quantity": "{quantityNumber}",
            "discount": "{discountAmount}",
            "tax": "{taxAmount}",
            "total": "{totalAmount}",
            "taxRate": "{taxRate}",
            "variantSku": "{variantSku}",
            "unitDiscount": "{unitDiscount}",
            "discounts": "{[discount1, discount2]}"
        }
    ],
    "shipments": [
        {
            "id": "{id}",
            "shipmentDiscount": "{shipmentDiscount}",
            "shipmentName": "{shipmentName}",
            "shipmentPrice": "{shipmentPrice}",
            "tax": "{tax}",
            "shipmentPriceTotal": "{shipmentPriceTotal}",
            "taxRate": "{taxRate}",
            "trackAndTrace": "{trackAndTrace}",
            "deliveryNote": "deliveryNote",
            "shipmentAddress": {
                "addressName": "{addressName}",
                "attention": "{attention}",
                "city": "{city}",
                "companyName": "{companyName}",
                "country": {
                    "cultureCode": "{cultureCode}",
                    "id": "{id}",
                    "name": "{counteryName}"
                },
                "emailAddress": "{email}",
                "firstName": "{firstName}",
                "id": "{id}",
                "lastName": "{lastName}",
                "line1": "{line1}",
                "line2": "{line2}",
                "mobilePhoneNumber": "{mobilePhoneNumber}",
                "phoneNumber": "{phoneNumber}",
                "postalCode": "{postalCode}",
                "state": "{state}"
            },
            "shippingMethod": {
                "id": "{id}",
                "name": "{name}",
                "defaultPaymentMethod": "{defaultPaymentMethod}",
                "eligiblePaymentMethods": [
                    {
                        "displayName": "{displayName}",
                        "feePercent": "{feePercent}",
                        "fees": [
                            {
                                "amount": "{amount}",
                                "priceGroupId": "{priceGroupId}"
                            }
                        ],
                        "id": "{id}",
                        "imageUrl": "{imageUrl}",
                        "name": "{paymentName}"
                    }
                ]
            },
            "orderLines": [
                {
                    "id": "{id}",
                    "sku": "{sku}",
                    "productName": "{productName}",
                    "price": "{price}",
                    "quantity": "{quantity}",
                    "discount": "{discount}",
                    "tax": "{tax}",
                    "total": "{total}",
                    "taxRate": "{taxRate}",
                    "variantSku": "{variantSku}",
                    "unitDiscount": "{unitDiscount}",
                    "discounts": "{[discount1, discount2]}"
                }
            ]
        }
    ],
    "orderAddresses": [
        {
            "addressName": "{addressName}",
            "attention": "{attention}",
            "city": "{city}",
            "companyName": "{companyName}",
            "country": {
                "cultureCode": "{cultureCode}",
                "id": "{id}",
                "name": "{counteryName}"
            },
            "emailAddress": "{email}",
            "firstName": "{firstName}",
            "id": "{id}",
            "lastName": "{lastName}",
            "line1": "{line1}",
            "line2": "{line2}",
            "mobilePhoneNumber": "{mobilePhoneNumber}",
            "phoneNumber": "{phoneNumber}",
            "postalCode": "{postalCode}",
            "state": "{state}"
        },
        {
            "addressName": "{addressName}",
            "attention": "{attention}",
            "city": "{city}",
            "companyName": "{companyName}",
            "country": {
                "cultureCode": "{cultureCode}",
                "id": "{id}",
                "name": "{countryId}"
            },
            "emailAddress": "{email}",
            "firstName": "{firstName}",
            "id": "id",
            "lastName": "{lastName}",
            "line1": "{line1}",
            "line2": "{line2}",
            "mobilePhoneNumber": "{mobilePhoneNumber}",
            "phoneNumber": "{phoneNumber}",
            "postalCode": "{postalCode}",
            "state": "{state}"
        }
    ]
}

Error Handling

Error
Description

BadRequest (400)

Execution of the pipeline fails or AccessToken was not attached.

Unauthorized (401)

The token is expired.

Forbidden (403)

The token does not have access to this endpoint.

NotFound (404)

Order or Payment not found.

Error Handling

Last updated

Was this helpful?