Order

Required access

read_orders access scope

An order represents an agreement to do business between a customer and a merchant.

Show definition
# An order represents an agreement to do business between a customer and a merchant.
type Order implements Node, CommentEventSubject {
  # Globally unique identifier.
  id: ID!

  # Whether the merchant added timeline comments to the order.
  hasTimelineComment: Boolean!

  # Generated messages that appear at the top of an order page in the Shopify admin.
  # For example, _this is a test order_.
  alerts: [ResourceAlert!]!

  # Mailing address provided by the customer.
  # Not all orders have mailing addresses.
  billingAddress: MailingAddress

  # Whether the billing address matches the shipping address.
  billingAddressMatchesShippingAddress: Boolean!

  # Whether the customer agreed to receive marketing materials.
  buyerAcceptsMarketing: Boolean!

  # Whether the order can be manually marked as paid.
  canMarkAsPaid: Boolean!

  # Reason the order was canceled.
  # Returns null if the order wasn't canceled.
  cancelReason: OrderCancelReason

  # Date and time when the order was canceled.
  # Returns null if the order wasn't canceled.
  cancelledAt: DateTime

  # Whether payment for the order can be captured.
  # Returns true when the customer's credit card has been authorized for payment and the authorization period has not expired.
  capturable: Boolean!

  # Amount of the order-level discount (does not contain any line item discounts).
  cartDiscountAmount: Money

  # Channel that created the order.
  channel: Channel

  # The ip address of the client that is associated with this order.
  clientIp: String

  # Whether the order is closed.
  closed: Boolean!

  # Date and time when the order closed.
  # If the order is not closed, then this field is null.
  closedAt: DateTime

  # Whether inventory has been reserved for the order.
  confirmed: Boolean!

  # Date and time when the order was created in Shopify.
  createdAt: DateTime!

  # The currency of the store at the time of the order.
  # If payment hasn't occurred, then this field is null.
  currencyCode: CurrencyCode!

  # Custom information added to the order by your customer
  #         (Also referred to as note attributes).
  customAttributes: [Attribute!]!

  # Unique identifier of the customer who placed the order.
  # Not all orders have customers associated with them.
  customer: Customer

  # Description of the customer's experience with the store leading up to the order.
  customerJourney: CustomerJourney

  # A two-letter or three-letter language code, optionally followed by a region modifier.
  # Example values could be 'en', 'en-CA', 'en-PIRATE'.
  customerLocale: String

  # Discount code provided by the customer.
  discountCode: String

  # Primary address of the customer, which is shown on the order.
  displayAddress: MailingAddress

  # Financial status of the order that can be shown to the merchant.
  # This field does not capture all the possible details of an order's financial
  # state and should only be used for display summary purposes.
  displayFinancialStatus: OrderDisplayFinancialStatus

  # Fulfillment status for the order that can be shown to the merchant.
  # This field does not capture all the possible details of an order's fulfillment
  # state. It should only be used for display summary purposes.
  displayFulfillmentStatus: OrderDisplayFulfillmentStatus!

  # Summary of each dispute associated with the order. Sorted in ascending (ASC) order by ID.
  disputes: [OrderDisputeSummary!]!

  # List of possible fulfilments that can be made for the order (includes line items that can be partially fulfilled).
  draftFulfillments: [DraftFulfillment!]!

  # Email address provided by the customer.
  email: String

  # List of internal events associated with the order.
  events(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false

    # Sort the underlying list by the given key.
    sortKey: EventSortKeys = ID

    # Supported filter parameters:
    #  - `created_at`
    #  - `comments`
    query: String
  ): EventConnection!

  # Whether there are items that can be fulfilled.
  # After an order is completely fulfilled (or completely refunded without any fulfillments) then this field returns false.
  fulfillable: Boolean!

  # List of shipments for the order.
  fulfillments(
    # Truncate the array result to this size.
    first: Int
  ): [Fulfillment!]!

  # Whether the order has been paid in full.
  fullyPaid: Boolean!

  # First page of the online store that the customer visited before they submitted the order, for displaying to humans.
  landingPageDisplayText: String

  # First page of the online store that the customer visited before they submitted the order.
  landingPageUrl: URL

  # List of the order's line items.
  lineItems(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false
  ): LineItemConnection!

  # If the order was processed using Shopify POS, then this is its location as provided by the merchant.
  location: String

  # Marketing attribution details for the order, if available.
  marketingAttribution: MarketingAttribution

  # Unique identifier for the order that appears on the order.
  # For example, _#1000_ or _Store1001.
  # This value is not unique across multiple stores.
  name: String!

  # Net payment for the order, based on the total amount received - total amount refunded.
  netPayment: Money!

  # Line items that can't be fulfilled.
  # For example, because some or all of the items have been refunded, or the item
  # is not one which can be fulfilled, such as a tip.
  # These line items would be 'lost' if you only considered the line items in draft fulfillments or fulfillments.
  nonFulfillableLineItems(
    # Returns up to the first `n` elements from the list.
    first: Int

    # Returns the elements that come after the specified cursor.
    after: String

    # Returns up to the last `n` elements from the list.
    last: Int

    # Returns the elements that come before the specified cursor.
    before: String

    # Reverse the order of the underlying list.
    reverse: Boolean = false
  ): LineItemConnection!

  # Contents of the note associated with the order.
  note: String

  # List of all payment gateways used for the order.
  # For example, _authorize_net_ and _Cash on Delivery (COD)_.
  paymentGatewayNames: [String!]!

  # Phone number provided by the customer.
  phone: String

  # If the order was processed using Shopify POS, then this is its location as provided by the merchant.
  physicalLocation: Location

  # Date and time when the order was processed.
  # When orders are imported from an app, this date and time may not match the date and time when the order was created.
  processedAt: DateTime!

  # Marketing referral code from the link that the customer clicked to visit your store.
  # Supports the following URL attributes: _ref_, _source_, or _r_. For example,
  # if the URL is myshopifystore.com/products/slide?ref=j2tj1tn2, then this value is j2tj1tn2.
  referralCode: String

  # Website that sent the customer to your online store.
  referrerDisplayText: String

  # Webpage where the customer clicked a link that sent them to your online store.
  # For example, _Google_ or _randomblog.com/page1_.
  referrerUrl: URL

  # Whether the order can be refunded.
  refundable: Boolean!

  # List of refunds that have been applied to the order.
  refunds(
    # Truncate the array result to this size.
    first: Int
  ): [Refund!]!

  # Whether any line item in the order requires physical shipping.
  requiresShipping: Boolean!

  # Whether the order can be restocked.
  restockable: Boolean!

  # Fraud risk level of the order.
  riskLevel: OrderRiskLevel!

  # The order's risk recommendation.
  riskRecommendation: OrderRiskRecommendation!

  # The order risks associated with this order.
  risks(
    # Truncate the array result to this size.
    first: Int
  ): [OrderRisk!]!

  # Mailing address for shipping provided by the customer.
  shippingAddress: MailingAddress

  # Line item that contains the shipping costs.
  shippingLine: ShippingLine

  # Subtotal of the line items and their discounts (does not contain shipping
  # costs, shipping discounts, and order-level discounts).
  subtotalPrice: Money

  # The details of the suggested refund. This response can be used to submit a RefundCreate mutation.
  suggestedRefund(
    shippingAmount: Money
    refundShipping: Boolean
    refundLineItems: [RefundLineItemInput!]

    # Whether a refund for all of the refundable line items on an order should be suggested.
    # If `true`, the suggested refund will be formed from all refundable line items and will
    # ignore any passed in `refundLineItems`.
    suggestFullRefund: Boolean = false
  ): SuggestedRefund

  # List of tags.
  tags: [String!]!

  # Taxes charged for the line item.
  taxLines: [TaxLine!]!

  # Whether taxes are included in the subtotal price of the order.
  taxesIncluded: Boolean!

  # Whether the order is a test.
  # Test orders are made using the Shopify Bogus Gateway or the Shopify Payments test mode.
  test: Boolean!

  # Amount authorized for the order, that is uncaptured or undercaptured.
  totalCapturable: Money!

  # Total amount discounted from the order (includes order-level and line item discounts).
  totalDiscounts: Money

  # Total amount of the order (includes taxes and discounts).
  totalPrice: Money!

  # Total amount received by the customer for the order.
  totalReceived: Money!

  # Total amount refunded for the order.
  totalRefunded: Money!

  # Total amount charged for shipping the order.
  totalShippingPrice: Money!

  # Total of all taxes applied to the order.
  totalTax: Money

  # Total weight (grams) of the order.
  totalWeight: UnsignedInt64

  # List of all transactions associated with the order.
  transactions(
    capturable: Boolean
    manuallyResolvable: Boolean

    # Truncate the array result to this size.
    first: Int
  ): [OrderTransaction!]!

  # Whether no payments have been made for the order.
  # If no payments have been made for the order, then this returns true.
  unpaid: Boolean!

  # Date and time when the order was last modified.
  updatedAt: DateTime!
}

Implements

Connections

events   (EventConnection!)

List of internal events associated with the order.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

query String

Supported filter parameters:

  • created_at
  • comments
reverse Boolean false

Reverse the order of the underlying list.

sortKey EventSortKeys ID

Sort the underlying list by the given key.

lineItems   (LineItemConnection!)

List of the order's line items.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

reverse Boolean false

Reverse the order of the underlying list.

nonFulfillableLineItems   (LineItemConnection!)

Line items that can't be fulfilled. For example, because some or all of the items have been refunded, or the item is not one which can be fulfilled, such as a tip. These line items would be 'lost' if you only considered the line items in draft fulfillments or fulfillments.

Argument Type Default Description
after String

Returns the elements that come after the specified cursor.

before String

Returns the elements that come before the specified cursor.

first Int

Returns up to the first n elements from the list.

last Int

Returns up to the last n elements from the list.

reverse Boolean false

Reverse the order of the underlying list.

Fields

alerts   ([ResourceAlert!]!)

Generated messages that appear at the top of an order page in the Shopify admin. For example, this is a test order.

billingAddress   (MailingAddress)

Mailing address provided by the customer. Not all orders have mailing addresses.

billingAddressMatchesShippingAddress   (Boolean!)

Whether the billing address matches the shipping address.

buyerAcceptsMarketing   (Boolean!)

Whether the customer agreed to receive marketing materials.

canMarkAsPaid   (Boolean!)

Whether the order can be manually marked as paid.

cancelReason   (OrderCancelReason)

Reason the order was canceled. Returns null if the order wasn't canceled.

cancelledAt   (DateTime)

Date and time when the order was canceled. Returns null if the order wasn't canceled.

capturable   (Boolean!)

Whether payment for the order can be captured. Returns true when the customer's credit card has been authorized for payment and the authorization period has not expired.

cartDiscountAmount   (Money)

Amount of the order-level discount (does not contain any line item discounts).

channel   (Channel)

Channel that created the order.

clientIp   (String)

The ip address of the client that is associated with this order.

closed   (Boolean!)

Whether the order is closed.

closedAt   (DateTime)

Date and time when the order closed. If the order is not closed, then this field is null.

confirmed   (Boolean!)

Whether inventory has been reserved for the order.

createdAt   (DateTime!)

Date and time when the order was created in Shopify.

currencyCode   (CurrencyCode!)

The currency of the store at the time of the order. If payment hasn't occurred, then this field is null.

customAttributes   ([Attribute!]!)

Custom information added to the order by your customer (Also referred to as note attributes).

customer   (Customer)

Unique identifier of the customer who placed the order. Not all orders have customers associated with them.

customerJourney   (CustomerJourney)

Description of the customer's experience with the store leading up to the order.

customerLocale   (String)

A two-letter or three-letter language code, optionally followed by a region modifier. Example values could be 'en', 'en-CA', 'en-PIRATE'.

discountCode   (String)

Discount code provided by the customer.

displayAddress   (MailingAddress)

Primary address of the customer, which is shown on the order.

displayFinancialStatus   (OrderDisplayFinancialStatus)

Financial status of the order that can be shown to the merchant. This field does not capture all the possible details of an order's financial state and should only be used for display summary purposes.

displayFulfillmentStatus   (OrderDisplayFulfillmentStatus!)

Fulfillment status for the order that can be shown to the merchant. This field does not capture all the possible details of an order's fulfillment state. It should only be used for display summary purposes.

disputes   ([OrderDisputeSummary!]!)

Summary of each dispute associated with the order. Sorted in ascending (ASC) order by ID.

draftFulfillments   ([DraftFulfillment!]!)

List of possible fulfilments that can be made for the order (includes line items that can be partially fulfilled).

email   (String)

Email address provided by the customer.

fulfillable   (Boolean!)

Whether there are items that can be fulfilled. After an order is completely fulfilled (or completely refunded without any fulfillments) then this field returns false.

fulfillments   ([Fulfillment!]!)

List of shipments for the order.

Argument Type Default Description
first Int

Truncate the array result to this size.

fullyPaid   (Boolean!)

Whether the order has been paid in full.

hasTimelineComment   (Boolean!)

Whether the merchant added timeline comments to the order.

id   (ID!)

Globally unique identifier.

name   (String!)

Unique identifier for the order that appears on the order. For example, #1000 or _Store1001. This value is not unique across multiple stores.

netPayment   (Money!)

Net payment for the order, based on the total amount received - total amount refunded.

note   (String)

Contents of the note associated with the order.

paymentGatewayNames   ([String!]!)

List of all payment gateways used for the order. For example, authorize_net and Cash on Delivery (COD).

phone   (String)

Phone number provided by the customer.

physicalLocation   (Location)

If the order was processed using Shopify POS, then this is its location as provided by the merchant.

processedAt   (DateTime!)

Date and time when the order was processed. When orders are imported from an app, this date and time may not match the date and time when the order was created.

refundable   (Boolean!)

Whether the order can be refunded.

refunds   ([Refund!]!)

List of refunds that have been applied to the order.

Argument Type Default Description
first Int

Truncate the array result to this size.

requiresShipping   (Boolean!)

Whether any line item in the order requires physical shipping.

restockable   (Boolean!)

Whether the order can be restocked.

riskLevel   (OrderRiskLevel!)

Fraud risk level of the order.

riskRecommendation   (OrderRiskRecommendation!)

The order's risk recommendation.

risks   ([OrderRisk!]!)

The order risks associated with this order.

Argument Type Default Description
first Int

Truncate the array result to this size.

shippingAddress   (MailingAddress)

Mailing address for shipping provided by the customer.

shippingLine   (ShippingLine)

Line item that contains the shipping costs.

subtotalPrice   (Money)

Subtotal of the line items and their discounts (does not contain shipping costs, shipping discounts, and order-level discounts).

suggestedRefund   (SuggestedRefund)

The details of the suggested refund. This response can be used to submit a RefundCreate mutation.

Argument Type Default Description
refundLineItems [RefundLineItemInput!]
refundShipping Boolean
shippingAmount Money
suggestFullRefund Boolean false

Whether a refund for all of the refundable line items on an order should be suggested. If true, the suggested refund will be formed from all refundable line items and will ignore any passed in refundLineItems.

tags   ([String!]!)

List of tags.

taxLines   ([TaxLine!]!)

Taxes charged for the line item.

taxesIncluded   (Boolean!)

Whether taxes are included in the subtotal price of the order.

test   (Boolean!)

Whether the order is a test. Test orders are made using the Shopify Bogus Gateway or the Shopify Payments test mode.

totalCapturable   (Money!)

Amount authorized for the order, that is uncaptured or undercaptured.

totalDiscounts   (Money)

Total amount discounted from the order (includes order-level and line item discounts).

totalPrice   (Money!)

Total amount of the order (includes taxes and discounts).

totalReceived   (Money!)

Total amount received by the customer for the order.

totalRefunded   (Money!)

Total amount refunded for the order.

totalShippingPrice   (Money!)

Total amount charged for shipping the order.

totalTax   (Money)

Total of all taxes applied to the order.

totalWeight   (UnsignedInt64)

Total weight (grams) of the order.

transactions   ([OrderTransaction!]!)

List of all transactions associated with the order.

Argument Type Default Description
capturable Boolean
first Int

Truncate the array result to this size.

manuallyResolvable Boolean

unpaid   (Boolean!)

Whether no payments have been made for the order. If no payments have been made for the order, then this returns true.

updatedAt   (DateTime!)

Date and time when the order was last modified.

Deprecated fields

Show/Hide

landingPageDisplayText   (String) deprecated

First page of the online store that the customer visited before they submitted the order, for displaying to humans.

Deprecation warning

Use customerJourney.lastVisit.landingPageHtml instead

landingPageUrl   (URL) deprecated

First page of the online store that the customer visited before they submitted the order.

Deprecation warning

Use customerJourney.lastVisit.landingPage instead

location   (String) deprecated

If the order was processed using Shopify POS, then this is its location as provided by the merchant.

Deprecation warning

Use physicalLocation instead

marketingAttribution   (MarketingAttribution) deprecated

Marketing attribution details for the order, if available.

Deprecation warning

Use customerJourney.firstVisit or customerJourney.lastVisit instead. customerJourney.firstVisit will be consistent with the current behavior.

referralCode   (String) deprecated

Marketing referral code from the link that the customer clicked to visit your store. Supports the following URL attributes: ref, source, or r. For example, if the URL is myshopifystore.com/products/slide?ref=j2tj1tn2, then this value is j2tj1tn2.

Deprecation warning

Use customerJourney.lastVisit.referralCode instead

referrerDisplayText   (String) deprecated

Website that sent the customer to your online store.

Deprecation warning

Use customerJourney.lastVisit.referralInfoHtml instead

referrerUrl   (URL) deprecated

Webpage where the customer clicked a link that sent them to your online store. For example, Google or randomblog.com/page1.

Deprecation warning

Use customerJourney.lastVisit.referrerUrl instead