Ucommerce
  • Ucommerce Next Gen
    • Getting Started
      • Prerequisites
      • Licensing
      • Ucommerce Templates
      • Headless Template
      • MVC Template
    • Headless
      • Postman Collection
      • Headless API Authentication
        • Token endpoint - Authorization Header
        • Authorization Scopes
        • Refreshing the Access Token
      • Reference
        • Cart
        • Cart / Order Line Items
        • Shipment
        • Billing
        • Promotion Codes
        • Price Groups
        • Payment Methods
        • Countries
        • Shipping Methods
        • Catalogs
        • Cart Custom Properties
        • Line Item Custom Properties
        • Orders
        • Views for Cart modifying operations
      • Custom Headless APIs
      • Error Handling
      • Pagination
      • Deprecation
    • Backoffice Authentication
      • Microsoft Entra ID Example
      • Auth0 Authentication Example
    • Definitions
      • What is a Definition
    • Search and indexing
      • Configuration
      • Indexing
        • Index Definitions
        • Facets
        • Indexing Prices
        • Suggestions
        • Custom Data
      • Searching
    • Payment Providers
      • Stripe Provider Integration
      • Implementing a custom payment provider
    • Data Import
    • Miscellaneous
      • Media
      • Price Group Inheritance
      • Price Group Criteria
      • Soft Deletion Of Entities
      • Logging
      • OpenTelemetry
    • Extensions
      • Extending Pipelines
        • Order Processing Pipelines
        • Checkout Pipelines
      • Changing Service Behavior
        • Images
        • Content
      • Custom Headless APIs
      • Extend the Backoffice
        • Custom UI Components
      • Custom Editor UI
      • Custom Promotion Criteria
      • Custom Price Group Criteria
    • How-To
      • Migrate from Classic
        • Common database issues
      • Entities from code
        • Bootstrapping data on startup
        • Product Definitions & Fields
      • Discover pipelines and their tasks
      • Executing a pipeline
    • Integrations
      • Umbraco Media Delivery API
      • App Slices
        • Product Picker
  • Release Notes
  • Contact Us
Powered by GitBook
On this page
  • Prerequisites
  • Get Order by Order ID
  • Request
  • Response
  • Error Handling
  • Get Order by Payment Guid
  • Request
  • Response
  • Error Handling
  • Related Articles

Was this helpful?

  1. Ucommerce Next Gen
  2. Headless
  3. Reference

Orders

Prerequisites

  • access_token from Headless API Authentication

  • orderId or paymentGuid

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}",
        "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; 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.

Related Articles

PreviousLine Item Custom PropertiesNextViews for Cart modifying operations

Last updated 2 months ago

Was this helpful?

Error Handling