Documentation

Ucommerce includes full API reference documentation and lots of helpful articles to help you build your e-commerce site as effortlessly as possible.

Topics Payment Providers
v7.18

Get order

This article will guide you through how to get your order with our headless API. The Postman collection will be used for all examples.

Prerequisites

Get order

Open the Get Order request.

Provide an orderId for the path variable.

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}",
            "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}",
        "vat": "{vatAmount}",
        "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}",
                "vat": "{vatAmount}",
                "total": "{totalAmount}",
                "vatRate": "{vatRate}",
                "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}",
                        "vat": "{vat}",
                        "total": "{total}",
                        "vatRate": "{vatRate}",
                        "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}"
            }
        ]
    }
    
    

Possible errors that may occur

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 with the supplied id orderId was not found.
    
    
    {
    "errors": [
            {
                "error-description": "Order with the supplied id orderId was not found",
                "error": "NotFound"
            }
        ]
    }
    
    

See Handling failures for more info.