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

1query {
2 order(publicId: "abc123") {
3 publicId
4 status
5 subTotal
6 taxTotal
7 total
8 place
9 created
10 }
11}

Get subscription details by order

Retrieve complete subscription details from order

1query {
2 order(publicId: "abc123") {
3 publicId
4 status
5 subTotal
6 shippingTotal
7 discountTotal
8 taxTotal
9 total
10 created
11 place
12 updated
13 customer {
14 merchantUserId
15 firstName
16 lastName
17 email
18 phoneNumber
19 }
20 shippingAddress {
21 publicId
22 firstName
23 lastName
24 address
25 address2
26 city
27 stateProvinceCode
28 zipPostalCode
29 countryCode
30 phone
31 }
32 payment {
33 publicId
34 ccType
35 ccNumberEnding
36 ccExpDate
37 ccHolder
38 paymentMethod
39 }
40 items {
41 nodes {
42 publicId
43 quantity
44 price
45 totalPrice
46 product {
47 name
48 externalProductId
49 sku
50 every
51 everyPeriod
52 }
53 subscription {
54 publicId
55 every
56 everyPeriod
57 }
58 }
59 }
60 }
61}

Get order with applied discounts

Order totals and line items with applied coupons and incentives

1query {
2 order(publicId: "abc123") {
3 publicId
4 status
5 subTotal
6 discountTotal
7 taxTotal
8 total
9 place
10 oneTimeIncentives {
11 publicId
12 externalCode
13 description
14 onetimeCouponType
15 stackingType
16 appliedAt
17 expires
18 }
19 items {
20 nodes {
21 publicId
22 quantity
23 price
24 totalPrice
25 product {
26 name
27 externalProductId
28 sku
29 }
30 oneTimeIncentives {
31 publicId
32 externalCode
33 description
34 onetimeCouponType
35 stackingType
36 appliedAt
37 }
38 }
39 }
40 }
41}

Get prepaid subscription status by order

Check prepaid subscription progress for each line item

1query {
2 order(publicId: "abc123") {
3 publicId
4 status
5 subTotal
6 total
7 place
8 items {
9 nodes {
10 publicId
11 quantity
12 price
13 totalPrice
14 product {
15 name
16 externalProductId
17 sku
18 }
19 subscription {
20 publicId
21 every
22 everyPeriod
23 prepaidSubscriptionContext {
24 prepaidOrdersRemaining
25 prepaidOrdersPerBilling
26 renewalBehavior
27 lastRenewalRevenue
28 prepaidOriginMerchantOrderId
29 }
30 }
31 }
32 }
33 }
34}