Skip to main content

Orders

The orders model represents completed purchases. Orders are created from carts via the checkout flow (Checkout.placeOrder or completeCheckout), not directly.

Order Service

The OrderService provides methods to retrieve order data.

getOrder

Retrieves a specific order by ID.

getOrder(
params: GetOrderParams,
authorization?: string
): Observable<Orders.Model.Order | undefined>

Parameters

ParameterTypeDescription
paramsGetOrderParamsParameters containing order ID
authorizationstringOptional authorization header

Params Parameters

ParameterTypeDescription
idstringOrder ID (required)

Returns

An Observable that emits the requested order or undefined if not found.

getOrderList

Retrieves a paginated list of orders with optional filtering.

getOrderList(
query: GetOrderListQuery,
authorization?: string
): Observable<Orders.Model.Orders>

Query Parameters

ParameterTypeDescription
idstringFilter by order ID
customerIdstringFilter by customer ID
statusOrderStatusFilter by order status
paymentStatusPaymentStatusFilter by payment status
dateFromDateFilter by creation date (from)
dateToDateFilter by creation date (to)
offsetnumberNumber of items to skip
limitnumberMaximum number of items to return
sortstringSorting criteria
localestringLocale for localized content

Returns

An Observable that emits a paginated list of orders.

Data Model Structure

Orders are created from carts via checkout. They contain:

  1. Order — Header with totals, status, addresses, shipping methods
  2. OrderItem — Line items with product, quantity, pricing
  3. Document — Invoices or other documents (optional)

Types

Order

FieldTypeDescription
idstringUnique identifier
customerIdstringCustomer ID (optional for guests)
emailstringGuest email (optional)
statusOrderStatusOrder status
paymentStatusPaymentStatusPayment status
totalPriceGrand total
subtotalPriceSubtotal (optional)
shippingTotalPriceShipping cost (optional)
discountTotalPriceDiscount (optional)
taxPriceTax (optional)
currencyCurrencyOrder currency
itemsdata, totalLine items
shippingAddressAddressShipping address (optional)
billingAddressAddressBilling address (optional)
shippingMethodsShippingMethod[]Shipping methods used
documentsDocument[]Invoices etc. (optional)
customerCommentstringCustomer comment (optional)
purchaseOrderNumberstringPO number (optional)
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp
paymentDueDatestringPayment due date (optional)

OrderItem

FieldTypeDescription
idstringUnique identifier
productIdstringProduct ID
quantitynumberQuantity
pricePriceUnit price
totalPriceLine total (optional)
subtotalPricePre-discount subtotal (optional)
discountTotalPriceItem discount (optional)
productProductProduct details

ShippingMethod

FieldTypeDescription
idstringUnique identifier
namestringDisplay name
descriptionstringDescription (optional)
totalPriceShipping cost (optional)
subtotalPriceSubtotal (optional)

Document

Represents an invoice or other order document.

FieldTypeDescription
idstringUnique identifier
orderIdstringOrder ID
typestringDocument type
statusPaymentStatusPayment status
toBePaidPriceAmount to be paid
totalPriceTotal amount
dueDatestringDue date
createdAtstringISO 8601 timestamp
updatedAtstringISO 8601 timestamp

OrderStatus

ValueDescription
PENDINGOrder pending processing
COMPLETEDOrder completed
SHIPPEDOrder shipped
CANCELLEDOrder cancelled
ARCHIVEDOrder archived
REQUIRES_ACTIONRequires customer action
UNKNOWNUnknown status

PaymentStatus

ValueDescription
PENDINGPayment pending
PAIDPayment completed
FAILEDPayment failed
REFUNDEDFully refunded
NOT_PAIDNot paid
CAPTUREDPayment captured
PARTIALLY_REFUNDEDPartially refunded
REQUIRES_ACTIONRequires customer action
UNKNOWNUnknown status

Orders

Paginated list of orders.

type Orders = Pagination.Paginated<Order>;