Schema Documentation

Order

Description

A order object

Fields
Field NameDescription
billing - CustomerAddress Order billing properties
cartHash - String Cart hash
cartTax - String Cart tax amount
Arguments
format - PricingFieldFormatEnum

Format of the price

commentCount - Int The number of comments. Even though WPGraphQL denotes this field as an integer, in WordPress this field should be saved as a numeric string for compatibility.
commentStatus - String Whether the comments are open or closed for this particular post.
couponLines - OrderToCouponLineConnection Connection between the Order type and the CouponLine type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

createdVia - String How order was created
currency - String Order currency
customer - Customer Order customer
customerIpAddress - String Customer IP Address
customerNote - String Customer note
customerUserAgent - String Customer User Agent
databaseId - Int The ID of the order in the database
date - String Date order was created
dateCompleted - String Date order was completed
datePaid - String Date order was paid
discountTax - String Discount tax amount
Arguments
format - PricingFieldFormatEnum

Format of the price

discountTotal - String Discount total amount
Arguments
format - PricingFieldFormatEnum

Format of the price

downloadableItems - OrderToDownloadableItemConnection Connection between the Order type and the DownloadableItem type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - OrderToDownloadableItemConnectionWhereArgs

Arguments for filtering the connection

feeLines - OrderToFeeLineConnection Connection between the Order type and the FeeLine type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

hasBillingAddress - Boolean Order has a billing address?
hasDownloadableItem - Boolean If order contains a downloadable product
hasShippingAddress - Boolean Order has a shipping address?
id - ID! The globally unique identifier for the order
isDownloadPermitted - Boolean Is product download is permitted
lineItems - OrderToLineItemConnection Connection between the Order type and the LineItem type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

metaData - [MetaData] Object meta data
Arguments
key - String

Retrieve meta by key

keysIn - [String]

Retrieve multiple metas by key

multiple - Boolean

Retrieve meta with matching keys

modified - String Date order was last updated
needsPayment - Boolean If order needs payment
needsProcessing - Boolean If order needs processing before it can be completed
needsShippingAddress - Boolean If order needs shipping address
orderKey - String Order key
orderNotes - OrderToCommentConnection Connection between the Order type and the Comment type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - OrderToCommentConnectionWhereArgs

Arguments for filtering the connection

orderNumber - String Order number
orderVersion - String Order version
parent - Order Parent order
paymentMethod - String Payment method
paymentMethodTitle - String Payment method title
pricesIncludeTax - Boolean Prices include taxes?
refunds - OrderToRefundConnection Connection between the Order type and the Refund type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

where - OrderToRefundConnectionWhereArgs

Arguments for filtering the connection

shipping - CustomerAddress Order shipping properties
shippingAddressMapUrl - String Order customer
shippingLines - OrderToShippingLineConnection Connection between the Order type and the ShippingLine type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

shippingTax - String Shipping tax amount
Arguments
format - PricingFieldFormatEnum

Format of the price

shippingTotal - String Shipping total amount
Arguments
format - PricingFieldFormatEnum

Format of the price

status - OrderStatusEnum Order status
subscriptions - [Subscription] Subscriptions on the order.
Arguments
limit - Int
offset - Int
subtotal - String Order subtotal
Arguments
format - PricingFieldFormatEnum

Format of the price

taxLines - OrderToTaxLineConnection Connection between the Order type and the TaxLine type
Arguments
first - Int

The number of items to return after the referenced "after" cursor

last - Int

The number of items to return before the referenced "before" cursor

after - String

Cursor used along with the "first" argument to reference where in the dataset to get data

before - String

Cursor used along with the "last" argument to reference where in the dataset to get data

total - String Order grand total
Arguments
format - PricingFieldFormatEnum

Format of the price

totalTax - String Order taxes
Arguments
format - PricingFieldFormatEnum

Format of the price

transactionId - String Transaction ID
Example
{"billing":CustomerAddress,"cartHash":"abc123","cartTax":"xyz789","commentCount":987,"commentStatus":"abc123","couponLines":OrderToCouponLineConnection,"createdVia":"abc123","currency":"abc123","customer":Customer,"customerIpAddress":"abc123","customerNote":"abc123","customerUserAgent":"abc123","databaseId":123,"date":"abc123","dateCompleted":"xyz789","datePaid":"abc123","discountTax":"xyz789","discountTotal":"xyz789","downloadableItems":OrderToDownloadableItemConnection,"feeLines":OrderToFeeLineConnection,"hasBillingAddress":true,"hasDownloadableItem":true,"hasShippingAddress":false,"id":"4","isDownloadPermitted":true,"lineItems":OrderToLineItemConnection,"metaData":[MetaData],"modified":"xyz789","needsPayment":true,"needsProcessing":true,"needsShippingAddress":false,"orderKey":"abc123","orderNotes":OrderToCommentConnection,"orderNumber":"abc123","orderVersion":"abc123","parent":Order,"paymentMethod":"xyz789","paymentMethodTitle":"xyz789","pricesIncludeTax":false,"refunds":OrderToRefundConnection,"shipping":CustomerAddress,"shippingAddressMapUrl":"xyz789","shippingLines":OrderToShippingLineConnection,"shippingTax":"xyz789","shippingTotal":"abc123","status":"CANCELLED","subscriptions":[Subscription],"subtotal":"abc123","taxLines":OrderToTaxLineConnection,"total":"abc123","totalTax":"xyz789","transactionId":"xyz789"}