order

Fetch a single order by its globally unique ID
View as Markdown

Retrieves a single order by its publicId. Returns an OrderType containing the order’s status, totals, customer, line items, payment, shipping address, and related subscription data.

Arguments

ArgumentTypeRequiredDescription
publicIdString!YesThe globally unique ID of the order.

Return type: OrderType

FieldTypeRequired
appliedIncentives[AppliedIncentiveType!]!Yes
cancelledDateTimeNo
createdDateTimeNo
currencyCodeStringNo
customerCustomerTypeNo
discountTotalDecimal!Yes
extraDataStringNo
genericErrorCountInt!Yes
hasPlanBoolean!Yes
itemsItemsPage!Yes
lockedBoolean!Yes
merchantPublicIdString!Yes
oneTimeIncentives[OneTimeIncentiveType!]!Yes
oosFreeShippingBoolean!Yes
orderMerchantIdStringNo
paymentPaymentTypeNo
placeDateTimeNo
publicIdStringNo
rejectedMessageStringNo
shippingAddressAddressTypeNo
shippingTotalDecimal!Yes
statusInt!Yes
subTotalDecimal!Yes
taxTotalDecimal!Yes
totalDecimal!Yes
triesInt!Yes
updatedDateTimeNo

Object-typed fields (such as customer, items, payment, shippingAddress, appliedIncentives, and oneTimeIncentives) expand to their own types. See the Objects reference for the full field definitions of each type.

Examples

Get basic order information

Quick lookup for order status and totals

query {
order(publicId: "abc123") {
publicId
status
subTotal
taxTotal
total
place
created
}
}

Get subscription details by order

Retrieve complete subscription details from order

query {
order(publicId: "abc123") {
publicId
status
subTotal
shippingTotal
discountTotal
taxTotal
total
created
place
updated
customer {
merchantUserId
firstName
lastName
email
phoneNumber
}
shippingAddress {
publicId
firstName
lastName
address
address2
city
stateProvinceCode
zipPostalCode
countryCode
phone
}
payment {
publicId
ccType
ccNumberEnding
ccExpDate
ccHolder
paymentMethod
}
items {
nodes {
publicId
quantity
price
totalPrice
product {
name
externalProductId
sku
every
everyPeriod
}
subscription {
publicId
every
everyPeriod
}
}
}
}
}

Get order with applied discounts

Order totals and line items with applied coupons and incentives

query {
order(publicId: "abc123") {
publicId
status
subTotal
discountTotal
taxTotal
total
place
oneTimeIncentives {
publicId
externalCode
description
onetimeCouponType
stackingType
appliedAt
expires
}
items {
nodes {
publicId
quantity
price
totalPrice
product {
name
externalProductId
sku
}
oneTimeIncentives {
publicId
externalCode
description
onetimeCouponType
stackingType
appliedAt
}
}
}
}
}

Get prepaid subscription status by order

Check prepaid subscription progress for each line item

query {
order(publicId: "abc123") {
publicId
status
subTotal
total
place
items {
nodes {
publicId
quantity
price
totalPrice
product {
name
externalProductId
sku
}
subscription {
publicId
every
everyPeriod
prepaidSubscriptionContext {
prepaidOrdersRemaining
prepaidOrdersPerBilling
renewalBehavior
lastRenewalRevenue
prepaidOriginMerchantOrderId
}
}
}
}
}
}