# Order - admin-graphql - OBJECT Version: 2024-10 ## Description An order is a customer's request to purchase one or more products from a shop. You can retrieve and update orders using the `Order` object. Learn more about [editing an existing order with the GraphQL Admin API](https://shopify.dev/apps/fulfillment/order-management-apps/order-editing). Only the last 60 days' worth of orders from a store are accessible from the `Order` object by default. If you want to access older orders, then you need to [request access to all orders](https://shopify.dev/api/usage/access-scopes#orders-permissions). If your app is granted access, then you can add the `read_all_orders` scope to your app along with `read_orders` or `write_orders`. [Private apps](https://shopify.dev/apps/auth/basic-http) are not affected by this change and are automatically granted the scope. **Caution:** Only use this data if it's required for your app's functionality. Shopify will restrict [access to scopes](https://shopify.dev/api/usage/access-scopes) for apps that don't have a legitimate use for the associated data. ### Access Scopes `read_orders` access scope or `read_marketplace_orders` access scope. ## Fields * [additionalFees](/docs/api/admin-graphql/2024-10/objects/AdditionalFee): AdditionalFee! - A list of additional fees applied to the order. * [alerts](/docs/api/admin-graphql/2024-10/objects/ResourceAlert): ResourceAlert! - A list of messages that appear on the order page in the Shopify admin. * [app](/docs/api/admin-graphql/2024-10/objects/OrderApp): OrderApp - The application that created the order. * [billingAddress](/docs/api/admin-graphql/2024-10/objects/MailingAddress): MailingAddress - The billing address of the customer. * [billingAddressMatchesShippingAddress](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the billing address matches the shipping address. * [canMarkAsPaid](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the order can be manually marked as paid. * [canNotifyCustomer](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether a customer email exists for the order. * [cancelReason](/docs/api/admin-graphql/2024-10/enums/OrderCancelReason): OrderCancelReason - The reason provided when the order was canceled. Returns `null` if the order wasn't canceled. * [cancellation](/docs/api/admin-graphql/2024-10/objects/OrderCancellation): OrderCancellation - Cancellation details for the order. * [cancelledAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime - The date and time when the order was canceled. Returns `null` if the order wasn't canceled. * [capturable](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether payment for the order can be captured. * [cartDiscountAmount](/docs/api/admin-graphql/2024-10/scalars/Money): Money - The total order-level discount amount, before returns, in shop currency. * [cartDiscountAmountSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag - The total order-level discount amount, before returns, in shop and presentment currencies. * [channel](/docs/api/admin-graphql/2024-10/objects/Channel): Channel - The channel that created the order. * [channelInformation](/docs/api/admin-graphql/2024-10/objects/ChannelInformation): ChannelInformation - Details about the channel that created the order. * [clientIp](/docs/api/admin-graphql/2024-10/scalars/String): String - The IP address of the API client that created the order. * [closed](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the order is closed. * [closedAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime - The date and time when the order was closed. Returns `null` if the order isn't closed. * [confirmationNumber](/docs/api/admin-graphql/2024-10/scalars/String): String - A randomly generated alpha-numeric identifier for the order that may be shown to the customer instead of the sequential order name. For example, "XPAV284CT", "R50KELTJP" or "35PKUN0UJ". This value isn't guaranteed to be unique. * [confirmed](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether inventory has been reserved for the order. * [createdAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! - Date and time when the order was created in Shopify. * [currencyCode](/docs/api/admin-graphql/2024-10/enums/CurrencyCode): CurrencyCode! - The shop currency when the order was placed. * [currentCartDiscountAmountSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The current order-level discount amount after all order updates, in shop and presentment currencies. * [currentShippingPriceSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The current shipping price after applying refunds and discounts. If the parent `order.taxesIncluded` field is true, then this price includes taxes. Otherwise, this field is the pre-tax price. * [currentSubtotalLineItemsQuantity](/docs/api/admin-graphql/2024-10/scalars/Int): Int! - The sum of the quantities for all line items that contribute to the order's current subtotal price. * [currentSubtotalPriceSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The sum of the prices for all line items after discounts and returns, in shop and presentment currencies. If `taxesIncluded` is `true`, then the subtotal also includes tax. * [currentTaxLines](/docs/api/admin-graphql/2024-10/objects/TaxLine): TaxLine! - A list of all tax lines applied to line items on the order, after returns. Tax line prices represent the total price for all tax lines with the same `rate` and `title`. * [currentTotalAdditionalFeesSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag - The total amount of additional fees after returns, in shop and presentment currencies. Returns `null` if there are no additional fees for the order. * [currentTotalDiscountsSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The total amount discounted on the order after returns, in shop and presentment currencies. This includes both order and line level discounts. * [currentTotalDutiesSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag - The total amount of duties after returns, in shop and presentment currencies. Returns `null` if duties aren't applicable. * [currentTotalPriceSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The total price of the order, after returns, in shop and presentment currencies. This includes taxes and discounts. * [currentTotalTaxSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The sum of the prices of all tax lines applied to line items on the order, after returns, in shop and presentment currencies. * [currentTotalWeight](/docs/api/admin-graphql/2024-10/scalars/UnsignedInt64): UnsignedInt64! - The total weight of the order after returns, in grams. * [customAttributes](/docs/api/admin-graphql/2024-10/objects/Attribute): Attribute! - A list of additional merchant-facing details that have been added to the order. For example, whether an order is a customer's first. * [customer](/docs/api/admin-graphql/2024-10/objects/Customer): Customer - The customer that placed the order. * [customerAcceptsMarketing](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the customer agreed to receive marketing materials. * [customerJourney](/docs/api/admin-graphql/2024-10/objects/CustomerJourney): CustomerJourney - The customer's visits and interactions with the online store before placing the order. * [customerJourneySummary](/docs/api/admin-graphql/2024-10/objects/CustomerJourneySummary): CustomerJourneySummary - The customer's visits and interactions with the online store before placing the order. * [customerLocale](/docs/api/admin-graphql/2024-10/scalars/String): String - A two-letter or three-letter language code, optionally followed by a region modifier. * [discountCode](/docs/api/admin-graphql/2024-10/scalars/String): String - The discount code used for the order. * [discountCodes](/docs/api/admin-graphql/2024-10/scalars/String): String! - The discount codes used for the order. * [displayAddress](/docs/api/admin-graphql/2024-10/objects/MailingAddress): MailingAddress - The primary address of the customer. Returns `null` if neither the shipping address nor the billing address was provided. * [displayFinancialStatus](/docs/api/admin-graphql/2024-10/enums/OrderDisplayFinancialStatus): OrderDisplayFinancialStatus - The financial status of the order that can be shown to the merchant. This field doesn't capture all the details of an order's financial state. It should only be used for display summary purposes. * [displayFulfillmentStatus](/docs/api/admin-graphql/2024-10/enums/OrderDisplayFulfillmentStatus): OrderDisplayFulfillmentStatus! - The fulfillment status for the order that can be shown to the merchant. This field does not capture all the details of an order's fulfillment state. It should only be used for display summary purposes. For a more granular view of the fulfillment status, refer to the [FulfillmentOrder](https://shopify.dev/api/admin-graphql/latest/objects/FulfillmentOrder) object. * [disputes](/docs/api/admin-graphql/2024-10/objects/OrderDisputeSummary): OrderDisputeSummary! - A list of the disputes associated with the order. * [dutiesIncluded](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether duties are included in the subtotal price of the order. * [edited](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the order has had any edits applied. * [email](/docs/api/admin-graphql/2024-10/scalars/String): String - The email address associated with the customer. * [estimatedTaxes](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether taxes on the order are estimated. This field returns `false` when taxes on the order are finalized and aren't subject to any changes. * [fulfillable](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether there are line items that can be fulfilled. This field returns `false` when the order has no fulfillable line items. For a more granular view of the fulfillment status, refer to the [FulfillmentOrder](https://shopify.dev/api/admin-graphql/latest/objects/FulfillmentOrder) object. * [fulfillments](/docs/api/admin-graphql/2024-10/objects/Fulfillment): Fulfillment! - List of shipments for the order. * [fulfillmentsCount](/docs/api/admin-graphql/2024-10/objects/Count): Count - The count of fulfillments including the cancelled fulfillments. * [fullyPaid](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the order has been paid in full. * [hasTimelineComment](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the merchant added a timeline comment to the order. * [id](/docs/api/admin-graphql/2024-10/scalars/ID): ID! - A globally-unique ID. * [landingPageDisplayText](/docs/api/admin-graphql/2024-10/scalars/String): String - The URL of the first page of the online store that the customer visited before they submitted the order. * [landingPageUrl](/docs/api/admin-graphql/2024-10/scalars/URL): URL - The first page of the online store that the customer visited before they submitted the order. * [legacyResourceId](/docs/api/admin-graphql/2024-10/scalars/UnsignedInt64): UnsignedInt64! - The ID of the corresponding resource in the REST Admin API. * [merchantBusinessEntity](/docs/api/admin-graphql/2024-10/objects/BusinessEntity): BusinessEntity! - The merchant's business entity associated with the order. * [merchantEditable](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the order can be edited by the merchant. For example, canceled orders can’t be edited. * [merchantEditableErrors](/docs/api/admin-graphql/2024-10/scalars/String): String! - A list of reasons why the order can't be edited. For example, "Canceled orders can't be edited". * [merchantOfRecordApp](/docs/api/admin-graphql/2024-10/objects/OrderApp): OrderApp - The application acting as the Merchant of Record for the order. * [metafield](/docs/api/admin-graphql/2024-10/objects/Metafield): Metafield - A [custom field](https://shopify.dev/docs/apps/build/custom-data), including its `namespace` and `key`, that's associated with a Shopify resource for the purposes of adding and storing additional information. * [name](/docs/api/admin-graphql/2024-10/scalars/String): String! - The unique identifier for the order that appears on the order page in the Shopify admin and the Order status page. For example, "#1001", "EN1001", or "1001-A". This value isn't unique across multiple stores. * [netPayment](/docs/api/admin-graphql/2024-10/scalars/Money): Money! - The net payment for the order, based on the total amount received minus the total amount refunded, in shop currency. * [netPaymentSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The net payment for the order, based on the total amount received minus the total amount refunded, in shop and presentment currencies. * [note](/docs/api/admin-graphql/2024-10/scalars/String): String - The contents of the note associated with the order. * [originalTotalAdditionalFeesSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag - The total amount of additional fees at the time of order creation, in shop and presentment currencies. Returns `null` if additional fees aren't applicable. * [originalTotalDutiesSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag - The total amount of duties at the time of order creation, in shop and presentment currencies. Returns `null` if duties aren't applicable. * [originalTotalPriceSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The total price of the order at the time of order creation, in shop and presentment currencies. * [paymentCollectionDetails](/docs/api/admin-graphql/2024-10/objects/OrderPaymentCollectionDetails): OrderPaymentCollectionDetails! - The payment collection details for the order. * [paymentGatewayNames](/docs/api/admin-graphql/2024-10/scalars/String): String! - A list of the names of all payment gateways used for the order. For example, "Shopify Payments" and "Cash on Delivery (COD)". * [paymentTerms](/docs/api/admin-graphql/2024-10/objects/PaymentTerms): PaymentTerms - The payment terms associated with the order. * [phone](/docs/api/admin-graphql/2024-10/scalars/String): String - The phone number associated with the customer. * [physicalLocation](/docs/api/admin-graphql/2024-10/objects/Location): Location - The fulfillment location that was assigned when the order was created. Orders can have multiple fulfillment orders. These fulfillment orders can each be assigned to a different location which is responsible for fulfilling a subset of the items in an order. The `Order.physicalLocation` field will only point to one of these locations. Use the [`FulfillmentOrder`](https://shopify.dev/api/admin-graphql/latest/objects/fulfillmentorder) object for up to date fulfillment location information. * [poNumber](/docs/api/admin-graphql/2024-10/scalars/String): String - The PO number associated with the order. * [presentmentCurrencyCode](/docs/api/admin-graphql/2024-10/enums/CurrencyCode): CurrencyCode! - The payment `CurrencyCode` of the customer for the order. * [privateMetafield](/docs/api/admin-graphql/2024-10/objects/PrivateMetafield): PrivateMetafield - Returns a private metafield by namespace and key that belongs to the resource. * [processedAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! - The date and time when the order was processed. This date and time might not match the date and time when the order was created. * [publication](/docs/api/admin-graphql/2024-10/objects/Publication): Publication - The publication that the order was created from. * [purchasingEntity](/docs/api/admin-graphql/2024-10/unions/PurchasingEntity): PurchasingEntity - The purchasing entity for the order. * [referralCode](/docs/api/admin-graphql/2024-10/scalars/String): String - The marketing referral code from the link that the customer clicked to visit the store. Supports the following URL attributes: "ref", "source", or "r". For example, if the URL is `{shop}.myshopify.com/products/slide?ref=j2tj1tn2`, then this value is `j2tj1tn2`. * [referrerDisplayText](/docs/api/admin-graphql/2024-10/scalars/String): String - A web domain or short description of the source that sent the customer to your online store. For example, "shopify.com" or "email". * [referrerUrl](/docs/api/admin-graphql/2024-10/scalars/URL): URL - The URL of the webpage where the customer clicked a link that sent them to your online store. * [refundDiscrepancySet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The difference between the suggested and actual refund amount of all refunds that have been applied to the order. A positive value indicates a difference in the merchant's favor, and a negative value indicates a difference in the customer's favor. * [refundable](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the order can be refunded. * [refunds](/docs/api/admin-graphql/2024-10/objects/Refund): Refund! - A list of refunds that have been applied to the order. * [registeredSourceUrl](/docs/api/admin-graphql/2024-10/scalars/URL): URL - The URL of the source that the order originated from, if found in the domain registry. * [requiresShipping](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the order has shipping lines or at least one line item on the order that requires shipping. * [restockable](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether any line item on the order can be restocked. * [retailLocation](/docs/api/admin-graphql/2024-10/objects/Location): Location - The physical location where a retail order is created or completed, except for draft POS orders completed via the “mark as paid” flow in Admin, which return null. * [returnStatus](/docs/api/admin-graphql/2024-10/enums/OrderReturnStatus): OrderReturnStatus! - The order's aggregated return status for display purposes. * [risk](/docs/api/admin-graphql/2024-10/objects/OrderRiskSummary): OrderRiskSummary! - The risk characteristics for the order. * [riskLevel](/docs/api/admin-graphql/2024-10/enums/OrderRiskLevel): OrderRiskLevel! - The fraud risk level of the order. * [risks](/docs/api/admin-graphql/2024-10/objects/OrderRisk): OrderRisk! - A list of risks associated with the order. * [shippingAddress](/docs/api/admin-graphql/2024-10/objects/MailingAddress): MailingAddress - The mailing address of the customer. * [shippingLine](/docs/api/admin-graphql/2024-10/objects/ShippingLine): ShippingLine - A summary of all shipping costs on the order. * [shopifyProtect](/docs/api/admin-graphql/2024-10/objects/ShopifyProtectOrderSummary): ShopifyProtectOrderSummary - The Shopify Protect details for the order. If Shopify Protect is disabled for the shop, then this will be null. * [sourceIdentifier](/docs/api/admin-graphql/2024-10/scalars/String): String - A unique POS or third party order identifier. For example, "1234-12-1000" or "111-98567-54". The `receipt_number` field is derived from this value for POS orders. * [sourceName](/docs/api/admin-graphql/2024-10/scalars/String): String - The name of the source associated with the order. * [staffMember](/docs/api/admin-graphql/2024-10/objects/StaffMember): StaffMember - The staff member associated with the order. * [statusPageUrl](/docs/api/admin-graphql/2024-10/scalars/URL): URL! - The URL where the customer can check the order's current status. * [subtotalLineItemsQuantity](/docs/api/admin-graphql/2024-10/scalars/Int): Int! - The sum of the quantities for all line items that contribute to the order's subtotal price. * [subtotalPrice](/docs/api/admin-graphql/2024-10/scalars/Money): Money - The sum of the prices for all line items after discounts and before returns, in shop currency. If `taxesIncluded` is `true`, then the subtotal also includes tax. * [subtotalPriceSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag - The sum of the prices for all line items after discounts and before returns, in shop and presentment currencies. If `taxesIncluded` is `true`, then the subtotal also includes tax. * [suggestedRefund](/docs/api/admin-graphql/2024-10/objects/SuggestedRefund): SuggestedRefund - A suggested refund for the order. * [tags](/docs/api/admin-graphql/2024-10/scalars/String): String! - A comma separated list of tags associated with the order. Updating `tags` overwrites any existing tags that were previously added to the order. To add new tags without overwriting existing tags, use the [tagsAdd](https://shopify.dev/api/admin-graphql/latest/mutations/tagsadd) mutation. * [taxExempt](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether taxes are exempt on the order. * [taxLines](/docs/api/admin-graphql/2024-10/objects/TaxLine): TaxLine! - A list of all tax lines applied to line items on the order, before returns. Tax line prices represent the total price for all tax lines with the same `rate` and `title`. * [taxesIncluded](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether taxes are included in the subtotal price of the order. * [test](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether the order is a test. Test orders are made using the Shopify Bogus Gateway or a payment provider with test mode enabled. A test order can't be converted into a real order and vice versa. * [totalCapturable](/docs/api/admin-graphql/2024-10/scalars/Money): Money! - The authorized amount that's uncaptured or undercaptured, in shop currency. This amount isn't adjusted for returns. * [totalCapturableSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The authorized amount that's uncaptured or undercaptured, in shop and presentment currencies. This amount isn't adjusted for returns. * [totalCashRoundingAdjustment](/docs/api/admin-graphql/2024-10/objects/CashRoundingAdjustment): CashRoundingAdjustment! - The total rounding adjustment applied to payments or refunds for an Order involving cash payments. Applies to some countries where cash transactions are rounded to the nearest currency denomination. * [totalDiscounts](/docs/api/admin-graphql/2024-10/scalars/Money): Money - The total amount discounted on the order before returns, in shop currency. This includes both order and line level discounts. * [totalDiscountsSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag - The total amount discounted on the order before returns, in shop and presentment currencies. This includes both order and line level discounts. * [totalOutstandingSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The total amount not yet transacted for the order, in shop and presentment currencies. A positive value indicates a difference in the merchant's favor (payment from customer to merchant) and a negative value indicates a difference in the customer's favor (refund from merchant to customer). * [totalPrice](/docs/api/admin-graphql/2024-10/scalars/Money): Money! - The total price of the order, before returns, in shop currency. This includes taxes and discounts. * [totalPriceSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The total price of the order, before returns, in shop and presentment currencies. This includes taxes and discounts. * [totalReceived](/docs/api/admin-graphql/2024-10/scalars/Money): Money! - The total amount received from the customer before returns, in shop currency. * [totalReceivedSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The total amount received from the customer before returns, in shop and presentment currencies. * [totalRefunded](/docs/api/admin-graphql/2024-10/scalars/Money): Money! - The total amount that was refunded, in shop currency. * [totalRefundedSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The total amount that was refunded, in shop and presentment currencies. * [totalRefundedShippingSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The total amount of shipping that was refunded, in shop and presentment currencies. * [totalShippingPrice](/docs/api/admin-graphql/2024-10/scalars/Money): Money! - The total shipping amount before discounts and returns, in shop currency. * [totalShippingPriceSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The total shipping amount before discounts and returns, in shop and presentment currencies. * [totalTax](/docs/api/admin-graphql/2024-10/scalars/Money): Money - The total tax amount before returns, in shop currency. * [totalTaxSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag - The total tax amount before returns, in shop and presentment currencies. * [totalTipReceived](/docs/api/admin-graphql/2024-10/objects/MoneyV2): MoneyV2! - The sum of all tip amounts for the order, in shop currency. * [totalTipReceivedSet](/docs/api/admin-graphql/2024-10/objects/MoneyBag): MoneyBag! - The sum of all tip amounts for the order, in shop and presentment currencies. * [totalWeight](/docs/api/admin-graphql/2024-10/scalars/UnsignedInt64): UnsignedInt64 - The total weight of the order before returns, in grams. * [transactions](/docs/api/admin-graphql/2024-10/objects/OrderTransaction): OrderTransaction! - A list of transactions associated with the order. * [transactionsCount](/docs/api/admin-graphql/2024-10/objects/Count): Count - The number of transactions associated with the order. * [unpaid](/docs/api/admin-graphql/2024-10/scalars/Boolean): Boolean! - Whether no payments have been made for the order. * [updatedAt](/docs/api/admin-graphql/2024-10/scalars/DateTime): DateTime! - The date and time when the order was modified last. ## Connections * [agreements](/docs/api/admin-graphql/2024-10/connections/SalesAgreementConnection): SalesAgreementConnection! * [discountApplications](/docs/api/admin-graphql/2024-10/connections/DiscountApplicationConnection): DiscountApplicationConnection! * [events](/docs/api/admin-graphql/2024-10/connections/EventConnection): EventConnection! * [fulfillmentOrders](/docs/api/admin-graphql/2024-10/connections/FulfillmentOrderConnection): FulfillmentOrderConnection! * [lineItems](/docs/api/admin-graphql/2024-10/connections/LineItemConnection): LineItemConnection! * [localizationExtensions](/docs/api/admin-graphql/2024-10/connections/LocalizationExtensionConnection): LocalizationExtensionConnection! * [metafieldDefinitions](/docs/api/admin-graphql/2024-10/connections/MetafieldDefinitionConnection): MetafieldDefinitionConnection! * [metafields](/docs/api/admin-graphql/2024-10/connections/MetafieldConnection): MetafieldConnection! * [nonFulfillableLineItems](/docs/api/admin-graphql/2024-10/connections/LineItemConnection): LineItemConnection! * [privateMetafields](/docs/api/admin-graphql/2024-10/connections/PrivateMetafieldConnection): PrivateMetafieldConnection! * [returns](/docs/api/admin-graphql/2024-10/connections/ReturnConnection): ReturnConnection! * [shippingLines](/docs/api/admin-graphql/2024-10/connections/ShippingLineConnection): ShippingLineConnection! ## Related queries * [order](/docs/api/admin-graphql/2024-10/queries/order) Returns an Order resource by ID. * [orders](/docs/api/admin-graphql/2024-10/queries/orders) Returns a list of orders placed in the store. ## Related mutations * [orderClose](/docs/api/admin-graphql/2024-10/mutations/orderClose) Closes an open order. * [orderCreate](/docs/api/admin-graphql/2024-10/mutations/orderCreate) Creates an order. * [orderEditCommit](/docs/api/admin-graphql/2024-10/mutations/orderEditCommit) Applies and saves staged changes to an order. Mutations are operating on `OrderEdit`. All order edits start with `orderEditBegin`, have any number of `orderEdit`* mutations made, and end with `orderEditCommit`. * [orderInvoiceSend](/docs/api/admin-graphql/2024-10/mutations/orderInvoiceSend) Sends an email invoice for an order. * [orderMarkAsPaid](/docs/api/admin-graphql/2024-10/mutations/orderMarkAsPaid) Marks an order as paid. You can only mark an order as paid if it isn't already fully paid. * [orderOpen](/docs/api/admin-graphql/2024-10/mutations/orderOpen) Opens a closed order. * [orderUpdate](/docs/api/admin-graphql/2024-10/mutations/orderUpdate) Updates the fields of an order. * [refundCreate](/docs/api/admin-graphql/2024-10/mutations/refundCreate) Creates a refund. ## Related Unions * [CommentEventEmbed](/docs/api/admin-graphql/2024-10/unions/CommentEventEmbed) The main embed of a comment event. * [MetafieldReference](/docs/api/admin-graphql/2024-10/unions/MetafieldReference) The resource referenced by the metafield value. * [MetafieldReferencer](/docs/api/admin-graphql/2024-10/unions/MetafieldReferencer) Types of resources that may use metafields to reference other resources. ## Examples ### Calculates a refund Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) { order(id: $id) { id suggestedRefund(refundLineItems: $refundLineItems) { subtotalSet { shopMoney { amount currencyCode } presentmentMoney { amount currencyCode } } refundLineItems { lineItem { id } quantity } } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Order/469306983\",\n \"refundLineItems\": [\n {\n \"lineItemId\": \"gid://shopify/LineItem/983004162\",\n \"quantity\": 1\n }\n ]\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) {\n order(id: $id) {\n id\n suggestedRefund(refundLineItems: $refundLineItems) {\n subtotalSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n refundLineItems {\n lineItem {\n id\n }\n quantity\n }\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Order/469306983\",\n \"refundLineItems\": [\n {\n \"lineItemId\": \"gid://shopify/LineItem/983004162\",\n \"quantity\": 1\n }\n ]\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) {\n order(id: $id) {\n id\n suggestedRefund(refundLineItems: $refundLineItems) {\n subtotalSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n refundLineItems {\n lineItem {\n id\n }\n quantity\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Order/469306983\",\n \"refundLineItems\": [{\"lineItemId\"=>\"gid://shopify/LineItem/983004162\", \"quantity\"=>1}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) {\n order(id: $id) {\n id\n suggestedRefund(refundLineItems: $refundLineItems) {\n subtotalSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n refundLineItems {\n lineItem {\n id\n }\n quantity\n }\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Order/469306983\",\n \"refundLineItems\": [\n {\n \"lineItemId\": \"gid://shopify/LineItem/983004162\",\n \"quantity\": 1\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query SuggestedRefund($id: ID!, $refundLineItems: [RefundLineItemInput!]) {\n order(id: $id) {\n id\n suggestedRefund(refundLineItems: $refundLineItems) {\n subtotalSet {\n shopMoney {\n amount\n currencyCode\n }\n presentmentMoney {\n amount\n currencyCode\n }\n }\n refundLineItems {\n lineItem {\n id\n }\n quantity\n }\n }\n }\n}" #### Graphql Input { "id": "gid://shopify/Order/469306983", "refundLineItems": [ { "lineItemId": "gid://shopify/LineItem/983004162", "quantity": 1 } ] } #### Graphql Response { "data": { "order": { "id": "gid://shopify/Order/469306983", "suggestedRefund": { "subtotalSet": { "shopMoney": { "amount": "8.26", "currencyCode": "USD" }, "presentmentMoney": { "amount": "7.0", "currencyCode": "EUR" } }, "refundLineItems": [ { "lineItem": { "id": "gid://shopify/LineItem/983004162" }, "quantity": 1 } ] } } } } ### Get a list of orders using their IDs and GraphQL aliases Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { order1: order(id: \\\"gid://shopify/Order/148977776\\\") { name } order2: order(id: \\\"gid://shopify/Order/1073459961\\\") { name } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order1: order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n order2: order(id: \"gid://shopify/Order/1073459961\") {\n name\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n order1: order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n order2: order(id: \"gid://shopify/Order/1073459961\") {\n name\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n order1: order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n order2: order(id: \"gid://shopify/Order/1073459961\") {\n name\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order1: order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n order2: order(id: \"gid://shopify/Order/1073459961\") {\n name\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "order1": { "name": "#1001" }, "order2": { "name": "#1018" } } } ### Get a metafield attached to an order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) { order(id: $ownerId) { purchaseOrder: metafield(namespace: $namespace, key: $key) { value } } }\",\n \"variables\": {\n \"namespace\": \"my_fields\",\n \"key\": \"purchase_order\",\n \"ownerId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n order(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }`,\n \"variables\": {\n \"namespace\": \"my_fields\",\n \"key\": \"purchase_order\",\n \"ownerId\": \"gid://shopify/Order/148977776\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n order(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }\nQUERY\n\nvariables = {\n \"namespace\": \"my_fields\",\n \"key\": \"purchase_order\",\n \"ownerId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n order(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }`,\n {\n variables: {\n \"namespace\": \"my_fields\",\n \"key\": \"purchase_order\",\n \"ownerId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query OrderMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n order(id: $ownerId) {\n purchaseOrder: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n}" #### Graphql Input { "namespace": "my_fields", "key": "purchase_order", "ownerId": "gid://shopify/Order/148977776" } #### Graphql Response { "data": { "order": { "purchaseOrder": { "value": "123" } } } } ### Get an order using the QueryRoot.node field and a GraphQL fragment Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { node(id: \\\"gid://shopify/Order/148977776\\\") { id ... on Order { name } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n node(id: \"gid://shopify/Order/148977776\") {\n id\n ... on Order {\n name\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n node(id: \"gid://shopify/Order/148977776\") {\n id\n ... on Order {\n name\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n node(id: \"gid://shopify/Order/148977776\") {\n id\n ... on Order {\n name\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n node(id: \"gid://shopify/Order/148977776\") {\n id\n ... on Order {\n name\n }\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "node": { "id": "gid://shopify/Order/148977776", "name": "#1001" } } } ### Get metafields attached to an order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query OrderMetafields($ownerId: ID!) { order(id: $ownerId) { metafields(first: 3) { edges { node { namespace key value } } } } }\",\n \"variables\": {\n \"ownerId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query OrderMetafields($ownerId: ID!) {\n order(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"ownerId\": \"gid://shopify/Order/148977776\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query OrderMetafields($ownerId: ID!) {\n order(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"ownerId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query OrderMetafields($ownerId: ID!) {\n order(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"ownerId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query OrderMetafields($ownerId: ID!) {\n order(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n}" #### Graphql Input { "ownerId": "gid://shopify/Order/148977776" } #### Graphql Response { "data": { "order": { "metafields": { "edges": [ { "node": { "namespace": "my_fields", "key": "purchase_order", "value": "123" } } ] } } } } ### Get pinned metafield definitions associated with an order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) { order(id: $ownerId) { metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) { edges { node { name namespace key type { name } } } } } }\",\n \"variables\": {\n \"pinnedStatus\": \"PINNED\",\n \"ownerId\": \"gid://shopify/Order/148977776\",\n \"first\": 10,\n \"sortKey\": \"PINNED_POSITION\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {\n order(id: $ownerId) {\n metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {\n edges {\n node {\n name\n namespace\n key\n type {\n name\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"pinnedStatus\": \"PINNED\",\n \"ownerId\": \"gid://shopify/Order/148977776\",\n \"first\": 10,\n \"sortKey\": \"PINNED_POSITION\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {\n order(id: $ownerId) {\n metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {\n edges {\n node {\n name\n namespace\n key\n type {\n name\n }\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"pinnedStatus\": \"PINNED\",\n \"ownerId\": \"gid://shopify/Order/148977776\",\n \"first\": 10,\n \"sortKey\": \"PINNED_POSITION\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {\n order(id: $ownerId) {\n metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {\n edges {\n node {\n name\n namespace\n key\n type {\n name\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"pinnedStatus\": \"PINNED\",\n \"ownerId\": \"gid://shopify/Order/148977776\",\n \"first\": 10,\n \"sortKey\": \"PINNED_POSITION\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query OrderMetafieldDefinitions($ownerId: ID!, $first: Int, $pinnedStatus: MetafieldDefinitionPinnedStatus, $sortKey: MetafieldDefinitionSortKeys) {\n order(id: $ownerId) {\n metafieldDefinitions(first: $first, pinnedStatus: $pinnedStatus, sortKey: $sortKey) {\n edges {\n node {\n name\n namespace\n key\n type {\n name\n }\n }\n }\n }\n }\n}" #### Graphql Input { "pinnedStatus": "PINNED", "ownerId": "gid://shopify/Order/148977776", "first": 10, "sortKey": "PINNED_POSITION" } #### Graphql Response { "data": { "order": { "metafieldDefinitions": { "edges": [ { "node": { "name": "Delivery Instructions", "namespace": "my_fields", "key": "delivery_instructions", "type": { "name": "single_line_text_field" } } }, { "node": { "name": "Purchase Order", "namespace": "my_fields", "key": "purchase_order", "type": { "name": "single_line_text_field" } } } ] } } } } ### Get sales agreements for an order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { order(id: \\\"gid://shopify/Order/816964372\\\") { agreements(first: 10) { edges { node { id happenedAt sales(first: 10) { edges { node { actionType lineType quantity totalAmount { shopMoney { amount } } ... on ProductSale { lineItem { id name } } ... on ShippingLineSale { shippingLine { id } } } } } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order(id: \"gid://shopify/Order/816964372\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n ... on ShippingLineSale {\n shippingLine {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n order(id: \"gid://shopify/Order/816964372\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n ... on ShippingLineSale {\n shippingLine {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n order(id: \"gid://shopify/Order/816964372\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n ... on ShippingLineSale {\n shippingLine {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order(id: \"gid://shopify/Order/816964372\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n ... on ShippingLineSale {\n shippingLine {\n id\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "order": { "agreements": { "edges": [ { "node": { "id": "gid://shopify/SalesAgreement/466882664", "happenedAt": "2005-07-31T15:57:11Z", "sales": { "edges": [ { "node": { "actionType": "ORDER", "lineType": "SHIPPING", "quantity": null, "totalAmount": { "shopMoney": { "amount": "5.0" } }, "shippingLine": { "id": "gid://shopify/ShippingLine/816964372" } } }, { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 3, "totalAmount": { "shopMoney": { "amount": "30.0" } }, "lineItem": { "id": "gid://shopify/LineItem/406313524", "name": "Draft - 151cm" } } } ] } } } ] } } } } ### Get sales agreements for order edits Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { order(id: \\\"gid://shopify/Order/116757651\\\") { agreements(first: 10) { edges { node { id happenedAt sales(first: 10) { edges { node { actionType lineType quantity totalAmount { shopMoney { amount } } ... on ProductSale { lineItem { id name } } } } } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order(id: \"gid://shopify/Order/116757651\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n order(id: \"gid://shopify/Order/116757651\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n order(id: \"gid://shopify/Order/116757651\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order(id: \"gid://shopify/Order/116757651\") {\n agreements(first: 10) {\n edges {\n node {\n id\n happenedAt\n sales(first: 10) {\n edges {\n node {\n actionType\n lineType\n quantity\n totalAmount {\n shopMoney {\n amount\n }\n }\n ... on ProductSale {\n lineItem {\n id\n name\n }\n }\n }\n }\n }\n }\n }\n }\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "order": { "agreements": { "edges": [ { "node": { "id": "gid://shopify/SalesAgreement/621397082", "happenedAt": "2019-04-15T15:57:11Z", "sales": { "edges": [ { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 3, "totalAmount": { "shopMoney": { "amount": "31.05" } }, "lineItem": { "id": "gid://shopify/LineItem/114976433", "name": "Wall Climber - 158cm" } } }, { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 2, "totalAmount": { "shopMoney": { "amount": "20.7" } }, "lineItem": { "id": "gid://shopify/LineItem/763128379", "name": "Hill Zipper - 151cm" } } }, { "node": { "actionType": "ORDER", "lineType": "SHIPPING", "quantity": null, "totalAmount": { "shopMoney": { "amount": "5.0" } } } } ] } } }, { "node": { "id": "gid://shopify/SalesAgreement/731429684", "happenedAt": "2019-04-16T11:52:10Z", "sales": { "edges": [ { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 2, "totalAmount": { "shopMoney": { "amount": "38.28" } }, "lineItem": { "id": "gid://shopify/LineItem/1001351938", "name": "Custom Zebra" } } }, { "node": { "actionType": "RETURN", "lineType": "PRODUCT", "quantity": -2, "totalAmount": { "shopMoney": { "amount": "-20.7" } }, "lineItem": { "id": "gid://shopify/LineItem/114976433", "name": "Wall Climber - 158cm" } } }, { "node": { "actionType": "ORDER", "lineType": "PRODUCT", "quantity": 2, "totalAmount": { "shopMoney": { "amount": "20.7" } }, "lineItem": { "id": "gid://shopify/LineItem/763128379", "name": "Hill Zipper - 151cm" } } } ] } } } ] } } } } ### Get shipping lines for an order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query shippingLinesByOrder($id: ID!) { order(id: $id) { shippingLines(first: 10, includeRemovals: true) { edges { node { id title isRemoved } } } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/Order/816964372\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query shippingLinesByOrder($id: ID!) {\n order(id: $id) {\n shippingLines(first: 10, includeRemovals: true) {\n edges {\n node {\n id\n title\n isRemoved\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/Order/816964372\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query shippingLinesByOrder($id: ID!) {\n order(id: $id) {\n shippingLines(first: 10, includeRemovals: true) {\n edges {\n node {\n id\n title\n isRemoved\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/Order/816964372\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query shippingLinesByOrder($id: ID!) {\n order(id: $id) {\n shippingLines(first: 10, includeRemovals: true) {\n edges {\n node {\n id\n title\n isRemoved\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/Order/816964372\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query shippingLinesByOrder($id: ID!) {\n order(id: $id) {\n shippingLines(first: 10, includeRemovals: true) {\n edges {\n node {\n id\n title\n isRemoved\n }\n }\n }\n }\n}" #### Graphql Input { "id": "gid://shopify/Order/816964372" } #### Graphql Response { "data": { "order": { "shippingLines": { "edges": [ { "node": { "id": "gid://shopify/ShippingLine/816964372", "title": "Ground Service", "isRemoved": true } }, { "node": { "id": "gid://shopify/ShippingLine/1072813969", "title": "Some shipping charge", "isRemoved": false } } ] } } } } ### Preview a full duty refund Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query suggestedRefund { order(id: \\\"gid://shopify/Order/469306983\\\") { suggestedRefund(refundDuties: [{dutyId: \\\"gid://shopify/Duty/1064114503\\\", refundType: FULL}]) { refundDuties { amountSet { shopMoney { amount currencyCode } } originalDuty { id } } totalDutiesSet { shopMoney { amount currencyCode } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: FULL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: FULL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: FULL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: FULL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "order": { "suggestedRefund": { "refundDuties": [ { "amountSet": { "shopMoney": { "amount": "8.97", "currencyCode": "USD" } }, "originalDuty": { "id": "gid://shopify/Duty/1064114503" } } ], "totalDutiesSet": { "shopMoney": { "amount": "8.97", "currencyCode": "USD" } } } } } } ### Preview a proportional duty refund Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query suggestedRefund { order(id: \\\"gid://shopify/Order/469306983\\\") { suggestedRefund(refundLineItems: [{lineItemId: \\\"gid://shopify/LineItem/983004162\\\", quantity: 1}], refundDuties: [{dutyId: \\\"gid://shopify/Duty/1064114503\\\", refundType: PROPORTIONAL}]) { refundDuties { amountSet { shopMoney { amount currencyCode } } originalDuty { id } } totalDutiesSet { shopMoney { amount currencyCode } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundLineItems: [{lineItemId: \"gid://shopify/LineItem/983004162\", quantity: 1}], refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: PROPORTIONAL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundLineItems: [{lineItemId: \"gid://shopify/LineItem/983004162\", quantity: 1}], refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: PROPORTIONAL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundLineItems: [{lineItemId: \"gid://shopify/LineItem/983004162\", quantity: 1}], refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: PROPORTIONAL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query suggestedRefund {\n order(id: \"gid://shopify/Order/469306983\") {\n suggestedRefund(refundLineItems: [{lineItemId: \"gid://shopify/LineItem/983004162\", quantity: 1}], refundDuties: [{dutyId: \"gid://shopify/Duty/1064114503\", refundType: PROPORTIONAL}]) {\n refundDuties {\n amountSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n originalDuty {\n id\n }\n }\n totalDutiesSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "order": { "suggestedRefund": { "refundDuties": [ { "amountSet": { "shopMoney": { "amount": "8.97", "currencyCode": "USD" } }, "originalDuty": { "id": "gid://shopify/Duty/1064114503" } } ], "totalDutiesSet": { "shopMoney": { "amount": "8.97", "currencyCode": "USD" } } } } } } ### Retrieve a specific order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { order(id: \\\"gid://shopify/Order/148977776\\\") { name } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order(id: \"gid://shopify/Order/148977776\") {\n name\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "order": { "name": "#1001" } } } ### Retrieve duties applied to an order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query { order(id: \\\"gid://shopify/Order/469306983\\\") { currentTotalDutiesSet { shopMoney { amount } } lineItems(first: 10) { edges { node { id name refundableQuantity duties { id harmonizedSystemCode price { shopMoney { amount } } } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n order(id: \"gid://shopify/Order/469306983\") {\n currentTotalDutiesSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 10) {\n edges {\n node {\n id\n name\n refundableQuantity\n duties {\n id\n harmonizedSystemCode\n price {\n shopMoney {\n amount\n }\n }\n }\n }\n }\n }\n }\n }`,\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query {\n order(id: \"gid://shopify/Order/469306983\") {\n currentTotalDutiesSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 10) {\n edges {\n node {\n id\n name\n refundableQuantity\n duties {\n id\n harmonizedSystemCode\n price {\n shopMoney {\n amount\n }\n }\n }\n }\n }\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n order(id: \"gid://shopify/Order/469306983\") {\n currentTotalDutiesSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 10) {\n edges {\n node {\n id\n name\n refundableQuantity\n duties {\n id\n harmonizedSystemCode\n price {\n shopMoney {\n amount\n }\n }\n }\n }\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n order(id: \"gid://shopify/Order/469306983\") {\n currentTotalDutiesSet {\n shopMoney {\n amount\n }\n }\n lineItems(first: 10) {\n edges {\n node {\n id\n name\n refundableQuantity\n duties {\n id\n harmonizedSystemCode\n price {\n shopMoney {\n amount\n }\n }\n }\n }\n }\n }\n }\n}" #### Graphql Input null #### Graphql Response { "data": { "order": { "currentTotalDutiesSet": { "shopMoney": { "amount": "8.97" } }, "lineItems": { "edges": [ { "node": { "id": "gid://shopify/LineItem/983004162", "name": "Element - 151cm", "refundableQuantity": 1, "duties": [ { "id": "gid://shopify/Duty/1064114503", "harmonizedSystemCode": "91051930", "price": { "shopMoney": { "amount": "8.97" } } } ] } } ] } } } } ### Retrieves a count of an order's transactions Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query TransactionsCountForOrder($orderId: ID!) { order(id: $orderId) { transactionsCount { count } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query TransactionsCountForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactionsCount {\n count\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query TransactionsCountForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactionsCount {\n count\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query TransactionsCountForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactionsCount {\n count\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query TransactionsCountForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactionsCount {\n count\n }\n }\n}" #### Graphql Input { "orderId": "gid://shopify/Order/148977776" } #### Graphql Response { "data": { "order": { "transactionsCount": { "count": 4 } } } } ### Retrieves a count of fulfillments associated with a specific order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query FulfillmentsCount($orderId: ID!) { order(id: $orderId) { fulfillmentsCount { count } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query FulfillmentsCount($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentsCount {\n count\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query FulfillmentsCount($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentsCount {\n count\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query FulfillmentsCount($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentsCount {\n count\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query FulfillmentsCount($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentsCount {\n count\n }\n }\n}" #### Graphql Input { "orderId": "gid://shopify/Order/148977776" } #### Graphql Response { "data": { "order": { "fulfillmentsCount": { "count": 0 } } } } ### Retrieves a list of all order risks for an order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query OrderRiskAssessmentsList($orderId: ID!) { order(id: $orderId) { risk { assessments { riskLevel provider { title } facts { description sentiment } } recommendation } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/647667644\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query OrderRiskAssessmentsList($orderId: ID!) {\n order(id: $orderId) {\n risk {\n assessments {\n riskLevel\n provider {\n title\n }\n facts {\n description\n sentiment\n }\n }\n recommendation\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/647667644\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query OrderRiskAssessmentsList($orderId: ID!) {\n order(id: $orderId) {\n risk {\n assessments {\n riskLevel\n provider {\n title\n }\n facts {\n description\n sentiment\n }\n }\n recommendation\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/647667644\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query OrderRiskAssessmentsList($orderId: ID!) {\n order(id: $orderId) {\n risk {\n assessments {\n riskLevel\n provider {\n title\n }\n facts {\n description\n sentiment\n }\n }\n recommendation\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/647667644\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query OrderRiskAssessmentsList($orderId: ID!) {\n order(id: $orderId) {\n risk {\n assessments {\n riskLevel\n provider {\n title\n }\n facts {\n description\n sentiment\n }\n }\n recommendation\n }\n }\n}" #### Graphql Input { "orderId": "gid://shopify/Order/647667644" } #### Graphql Response { "data": { "order": { "risk": { "assessments": [ { "riskLevel": "HIGH", "provider": null, "facts": [ { "description": "The order is high risk.", "sentiment": "NEGATIVE" } ] }, { "riskLevel": "MEDIUM", "provider": { "title": "Private Mobile App for Channel" }, "facts": [] } ], "recommendation": "NONE" } } } } ### Retrieves a list of fulfillment orders for a specific order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query FulfillmentOrderList($orderId: ID!) { order(id: $orderId) { fulfillmentOrders(first: 250) { nodes { id createdAt updatedAt requestStatus status fulfillAt destination { id address1 address2 city company countryCode email firstName lastName phone province zip } lineItems(first: 250) { nodes { id totalQuantity inventoryItemId remainingQuantity variant { id } } } internationalDuties { incoterm } fulfillmentHolds { reason reasonNotes } fulfillBy deliveryMethod { id methodType minDeliveryDateTime maxDeliveryDateTime additionalInformation { instructions phone } serviceCode sourceReference presentedName brandedPromise { handle name } } assignedLocation { address1 address2 city countryCode location { id } name phone province zip } merchantRequests(first: 250) { nodes { message requestOptions kind } } } } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query FulfillmentOrderList($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentOrders(first: 250) {\n nodes {\n id\n createdAt\n updatedAt\n requestStatus\n status\n fulfillAt\n destination {\n id\n address1\n address2\n city\n company\n countryCode\n email\n firstName\n lastName\n phone\n province\n zip\n }\n lineItems(first: 250) {\n nodes {\n id\n totalQuantity\n inventoryItemId\n remainingQuantity\n variant {\n id\n }\n }\n }\n internationalDuties {\n incoterm\n }\n fulfillmentHolds {\n reason\n reasonNotes\n }\n fulfillBy\n deliveryMethod {\n id\n methodType\n minDeliveryDateTime\n maxDeliveryDateTime\n additionalInformation {\n instructions\n phone\n }\n serviceCode\n sourceReference\n presentedName\n brandedPromise {\n handle\n name\n }\n }\n assignedLocation {\n address1\n address2\n city\n countryCode\n location {\n id\n }\n name\n phone\n province\n zip\n }\n merchantRequests(first: 250) {\n nodes {\n message\n requestOptions\n kind\n }\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query FulfillmentOrderList($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentOrders(first: 250) {\n nodes {\n id\n createdAt\n updatedAt\n requestStatus\n status\n fulfillAt\n destination {\n id\n address1\n address2\n city\n company\n countryCode\n email\n firstName\n lastName\n phone\n province\n zip\n }\n lineItems(first: 250) {\n nodes {\n id\n totalQuantity\n inventoryItemId\n remainingQuantity\n variant {\n id\n }\n }\n }\n internationalDuties {\n incoterm\n }\n fulfillmentHolds {\n reason\n reasonNotes\n }\n fulfillBy\n deliveryMethod {\n id\n methodType\n minDeliveryDateTime\n maxDeliveryDateTime\n additionalInformation {\n instructions\n phone\n }\n serviceCode\n sourceReference\n presentedName\n brandedPromise {\n handle\n name\n }\n }\n assignedLocation {\n address1\n address2\n city\n countryCode\n location {\n id\n }\n name\n phone\n province\n zip\n }\n merchantRequests(first: 250) {\n nodes {\n message\n requestOptions\n kind\n }\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query FulfillmentOrderList($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentOrders(first: 250) {\n nodes {\n id\n createdAt\n updatedAt\n requestStatus\n status\n fulfillAt\n destination {\n id\n address1\n address2\n city\n company\n countryCode\n email\n firstName\n lastName\n phone\n province\n zip\n }\n lineItems(first: 250) {\n nodes {\n id\n totalQuantity\n inventoryItemId\n remainingQuantity\n variant {\n id\n }\n }\n }\n internationalDuties {\n incoterm\n }\n fulfillmentHolds {\n reason\n reasonNotes\n }\n fulfillBy\n deliveryMethod {\n id\n methodType\n minDeliveryDateTime\n maxDeliveryDateTime\n additionalInformation {\n instructions\n phone\n }\n serviceCode\n sourceReference\n presentedName\n brandedPromise {\n handle\n name\n }\n }\n assignedLocation {\n address1\n address2\n city\n countryCode\n location {\n id\n }\n name\n phone\n province\n zip\n }\n merchantRequests(first: 250) {\n nodes {\n message\n requestOptions\n kind\n }\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query FulfillmentOrderList($orderId: ID!) {\n order(id: $orderId) {\n fulfillmentOrders(first: 250) {\n nodes {\n id\n createdAt\n updatedAt\n requestStatus\n status\n fulfillAt\n destination {\n id\n address1\n address2\n city\n company\n countryCode\n email\n firstName\n lastName\n phone\n province\n zip\n }\n lineItems(first: 250) {\n nodes {\n id\n totalQuantity\n inventoryItemId\n remainingQuantity\n variant {\n id\n }\n }\n }\n internationalDuties {\n incoterm\n }\n fulfillmentHolds {\n reason\n reasonNotes\n }\n fulfillBy\n deliveryMethod {\n id\n methodType\n minDeliveryDateTime\n maxDeliveryDateTime\n additionalInformation {\n instructions\n phone\n }\n serviceCode\n sourceReference\n presentedName\n brandedPromise {\n handle\n name\n }\n }\n assignedLocation {\n address1\n address2\n city\n countryCode\n location {\n id\n }\n name\n phone\n province\n zip\n }\n merchantRequests(first: 250) {\n nodes {\n message\n requestOptions\n kind\n }\n }\n }\n }\n }\n}" #### Graphql Input { "orderId": "gid://shopify/Order/148977776" } #### Graphql Response { "data": { "order": { "fulfillmentOrders": { "nodes": [ { "id": "gid://shopify/FulfillmentOrder/564786110", "createdAt": "2024-11-20T18:26:47Z", "updatedAt": "2024-11-20T18:26:47Z", "requestStatus": "UNSUBMITTED", "status": "OPEN", "fulfillAt": null, "destination": { "id": "gid://shopify/FulfillmentOrderDestination/402903185", "address1": "123 Amoebobacterieae St", "address2": "Unit 806", "city": "Ottawa", "company": "", "countryCode": "CA", "email": "bob@example.com", "firstName": "Bob", "lastName": "Bobsen", "phone": "(555)555-5555", "province": "Ontario", "zip": "K2P0V6" }, "lineItems": { "nodes": [ { "id": "gid://shopify/FulfillmentOrderLineItem/445529754", "totalQuantity": 1, "inventoryItemId": "gid://shopify/InventoryItem/43729076", "remainingQuantity": 1, "variant": { "id": "gid://shopify/ProductVariant/43729076" } } ] }, "internationalDuties": { "incoterm": "DAP" }, "fulfillmentHolds": [], "fulfillBy": null, "deliveryMethod": { "id": "gid://shopify/DeliveryMethod/889454384", "methodType": "SHIPPING", "minDeliveryDateTime": null, "maxDeliveryDateTime": null, "additionalInformation": { "instructions": null, "phone": null }, "serviceCode": null, "sourceReference": null, "presentedName": null, "brandedPromise": null }, "assignedLocation": { "address1": "190 MacLaren Street", "address2": null, "city": "Ottawa", "countryCode": "CA", "location": { "id": "gid://shopify/Location/124656943" }, "name": "Shipping Origin", "phone": null, "province": "Ontario", "zip": "K2P 0L6" }, "merchantRequests": { "nodes": [] } } ] } } } } ### Retrieves a list of refunds for an order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query RefundList($orderId: ID!) { order(id: $orderId) { refunds(first: 10) { id note totalRefundedSet { presentmentMoney { amount currencyCode } } } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/647667644\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query RefundList($orderId: ID!) {\n order(id: $orderId) {\n refunds(first: 10) {\n id\n note\n totalRefundedSet {\n presentmentMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/647667644\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query RefundList($orderId: ID!) {\n order(id: $orderId) {\n refunds(first: 10) {\n id\n note\n totalRefundedSet {\n presentmentMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/647667644\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query RefundList($orderId: ID!) {\n order(id: $orderId) {\n refunds(first: 10) {\n id\n note\n totalRefundedSet {\n presentmentMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/647667644\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query RefundList($orderId: ID!) {\n order(id: $orderId) {\n refunds(first: 10) {\n id\n note\n totalRefundedSet {\n presentmentMoney {\n amount\n currencyCode\n }\n }\n }\n }\n}" #### Graphql Input { "orderId": "gid://shopify/Order/647667644" } #### Graphql Response { "data": { "order": { "refunds": [] } } } ### Retrieves a list of transactions Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query TransactionsForOrder($orderId: ID!) { order(id: $orderId) { transactions(first: 10) { accountNumber amountSet { presentmentMoney { amount currencyCode } shopMoney { amount currencyCode } } authorizationCode authorizationExpiresAt createdAt errorCode fees { amount { amount currencyCode } } formattedGateway gateway id kind manuallyCapturable maximumRefundableV2 { amount currencyCode } multiCapturable order { id } parentTransaction { id } paymentDetails { ... on CardPaymentDetails { paymentMethodName } ... on ShopPayInstallmentsPaymentDetails { paymentMethodName } } paymentIcon { url } paymentId processedAt receiptJson settlementCurrency shopifyPaymentsSet { refundSet { acquirerReferenceNumber } } status test totalUnsettledSet { presentmentMoney { amount currencyCode } shopMoney { amount currencyCode } } user { id } } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query TransactionsForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactions(first: 10) {\n accountNumber\n amountSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n authorizationCode\n authorizationExpiresAt\n createdAt\n errorCode\n fees {\n amount {\n amount\n currencyCode\n }\n }\n formattedGateway\n gateway\n id\n kind\n manuallyCapturable\n maximumRefundableV2 {\n amount\n currencyCode\n }\n multiCapturable\n order {\n id\n }\n parentTransaction {\n id\n }\n paymentDetails {\n ... on CardPaymentDetails {\n paymentMethodName\n }\n ... on ShopPayInstallmentsPaymentDetails {\n paymentMethodName\n }\n }\n paymentIcon {\n url\n }\n paymentId\n processedAt\n receiptJson\n settlementCurrency\n shopifyPaymentsSet {\n refundSet {\n acquirerReferenceNumber\n }\n }\n status\n test\n totalUnsettledSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n user {\n id\n }\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query TransactionsForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactions(first: 10) {\n accountNumber\n amountSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n authorizationCode\n authorizationExpiresAt\n createdAt\n errorCode\n fees {\n amount {\n amount\n currencyCode\n }\n }\n formattedGateway\n gateway\n id\n kind\n manuallyCapturable\n maximumRefundableV2 {\n amount\n currencyCode\n }\n multiCapturable\n order {\n id\n }\n parentTransaction {\n id\n }\n paymentDetails {\n ... on CardPaymentDetails {\n paymentMethodName\n }\n ... on ShopPayInstallmentsPaymentDetails {\n paymentMethodName\n }\n }\n paymentIcon {\n url\n }\n paymentId\n processedAt\n receiptJson\n settlementCurrency\n shopifyPaymentsSet {\n refundSet {\n acquirerReferenceNumber\n }\n }\n status\n test\n totalUnsettledSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n user {\n id\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query TransactionsForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactions(first: 10) {\n accountNumber\n amountSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n authorizationCode\n authorizationExpiresAt\n createdAt\n errorCode\n fees {\n amount {\n amount\n currencyCode\n }\n }\n formattedGateway\n gateway\n id\n kind\n manuallyCapturable\n maximumRefundableV2 {\n amount\n currencyCode\n }\n multiCapturable\n order {\n id\n }\n parentTransaction {\n id\n }\n paymentDetails {\n ... on CardPaymentDetails {\n paymentMethodName\n }\n ... on ShopPayInstallmentsPaymentDetails {\n paymentMethodName\n }\n }\n paymentIcon {\n url\n }\n paymentId\n processedAt\n receiptJson\n settlementCurrency\n shopifyPaymentsSet {\n refundSet {\n acquirerReferenceNumber\n }\n }\n status\n test\n totalUnsettledSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n user {\n id\n }\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query TransactionsForOrder($orderId: ID!) {\n order(id: $orderId) {\n transactions(first: 10) {\n accountNumber\n amountSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n authorizationCode\n authorizationExpiresAt\n createdAt\n errorCode\n fees {\n amount {\n amount\n currencyCode\n }\n }\n formattedGateway\n gateway\n id\n kind\n manuallyCapturable\n maximumRefundableV2 {\n amount\n currencyCode\n }\n multiCapturable\n order {\n id\n }\n parentTransaction {\n id\n }\n paymentDetails {\n ... on CardPaymentDetails {\n paymentMethodName\n }\n ... on ShopPayInstallmentsPaymentDetails {\n paymentMethodName\n }\n }\n paymentIcon {\n url\n }\n paymentId\n processedAt\n receiptJson\n settlementCurrency\n shopifyPaymentsSet {\n refundSet {\n acquirerReferenceNumber\n }\n }\n status\n test\n totalUnsettledSet {\n presentmentMoney {\n amount\n currencyCode\n }\n shopMoney {\n amount\n currencyCode\n }\n }\n user {\n id\n }\n }\n }\n}" #### Graphql Input { "orderId": "gid://shopify/Order/148977776" } #### Graphql Response { "data": { "order": { "transactions": [ { "accountNumber": "", "amountSet": { "presentmentMoney": { "amount": "11.5", "currencyCode": "USD" }, "shopMoney": { "amount": "11.5", "currencyCode": "USD" } }, "authorizationCode": "0", "authorizationExpiresAt": null, "createdAt": "2005-07-31T15:57:10Z", "errorCode": null, "fees": [], "formattedGateway": "(For Testing) Bogus Gateway", "gateway": "bogus", "id": "gid://shopify/OrderTransaction/42239183", "kind": "AUTHORIZATION", "manuallyCapturable": false, "maximumRefundableV2": null, "multiCapturable": true, "order": { "id": "gid://shopify/Order/148977776" }, "parentTransaction": null, "paymentDetails": null, "paymentIcon": null, "paymentId": "c148977776.1", "processedAt": "2005-07-31T15:57:10Z", "receiptJson": "{\"testcase\":true,\"response_code\":3,\"response_reason_code\":\"16\",\"response_reason_text\":\"The transaction cannot be found.\",\"avs_result_code\":\"P\",\"transaction_id\":\"0\",\"card_code\":\"M\"}", "settlementCurrency": null, "shopifyPaymentsSet": null, "status": "FAILURE", "test": false, "totalUnsettledSet": { "presentmentMoney": { "amount": "0.0", "currencyCode": "USD" }, "shopMoney": { "amount": "0.0", "currencyCode": "USD" } }, "user": null }, { "accountNumber": "", "amountSet": { "presentmentMoney": { "amount": "50.0", "currencyCode": "USD" }, "shopMoney": { "amount": "50.0", "currencyCode": "USD" } }, "authorizationCode": null, "authorizationExpiresAt": null, "createdAt": "2005-07-31T15:57:11Z", "errorCode": null, "fees": [], "formattedGateway": "(For Testing) Bogus Gateway", "gateway": "bogus", "id": "gid://shopify/OrderTransaction/607668304", "kind": "SALE", "manuallyCapturable": false, "maximumRefundableV2": null, "multiCapturable": true, "order": { "id": "gid://shopify/Order/148977776" }, "parentTransaction": null, "paymentDetails": null, "paymentIcon": null, "paymentId": "c148977776.3", "processedAt": "2005-07-31T15:57:11Z", "receiptJson": "{\"testcase\":true}", "settlementCurrency": null, "shopifyPaymentsSet": null, "status": "AWAITING_RESPONSE", "test": false, "totalUnsettledSet": { "presentmentMoney": { "amount": "0.0", "currencyCode": "USD" }, "shopMoney": { "amount": "0.0", "currencyCode": "USD" } }, "user": null }, { "accountNumber": "•••• •••• •••• 4242", "amountSet": { "presentmentMoney": { "amount": "11.5", "currencyCode": "USD" }, "shopMoney": { "amount": "11.5", "currencyCode": "USD" } }, "authorizationCode": "1001", "authorizationExpiresAt": null, "createdAt": "2005-07-31T15:57:10Z", "errorCode": null, "fees": [], "formattedGateway": "(For Testing) Bogus Gateway", "gateway": "bogus", "id": "gid://shopify/OrderTransaction/661056787", "kind": "AUTHORIZATION", "manuallyCapturable": false, "maximumRefundableV2": null, "multiCapturable": true, "order": { "id": "gid://shopify/Order/148977776" }, "parentTransaction": null, "paymentDetails": { "paymentMethodName": "card" }, "paymentIcon": { "url": "https://cdn.shopify.com/shopifycloud/shopify/assets/payment_icons/visa-319d545c6fd255c9aad5eeaad21fd6f7f7b4fdbdb1a35ce83b89cca12a187f00.svg.png" }, "paymentId": "c148977776.1", "processedAt": "2005-07-31T15:57:10Z", "receiptJson": "{\"testcase\":true,\"response_code\":1,\"response_reason_code\":\"1\",\"response_reason_text\":\"This transaction has been approved.\",\"avs_result_code\":\"Y\",\"transaction_id\":\"123456789\",\"card_code\":\"M\"}", "settlementCurrency": null, "shopifyPaymentsSet": null, "status": "SUCCESS", "test": false, "totalUnsettledSet": { "presentmentMoney": { "amount": "0.0", "currencyCode": "USD" }, "shopMoney": { "amount": "0.0", "currencyCode": "USD" } }, "user": null }, { "accountNumber": "•••• •••• •••• 4242", "amountSet": { "presentmentMoney": { "amount": "11.5", "currencyCode": "USD" }, "shopMoney": { "amount": "11.5", "currencyCode": "USD" } }, "authorizationCode": "1000", "authorizationExpiresAt": null, "createdAt": "2005-07-31T15:57:11Z", "errorCode": null, "fees": [], "formattedGateway": "(For Testing) Bogus Gateway", "gateway": "bogus", "id": "gid://shopify/OrderTransaction/999225631", "kind": "CAPTURE", "manuallyCapturable": false, "maximumRefundableV2": null, "multiCapturable": true, "order": { "id": "gid://shopify/Order/148977776" }, "parentTransaction": { "id": "gid://shopify/OrderTransaction/661056787" }, "paymentDetails": { "paymentMethodName": "card" }, "paymentIcon": { "url": "https://cdn.shopify.com/shopifycloud/shopify/assets/payment_icons/visa-319d545c6fd255c9aad5eeaad21fd6f7f7b4fdbdb1a35ce83b89cca12a187f00.svg.png" }, "paymentId": "c148977776.2", "processedAt": "2005-07-31T15:57:11Z", "receiptJson": "{\"testcase\":true}", "settlementCurrency": null, "shopifyPaymentsSet": null, "status": "SUCCESS", "test": false, "totalUnsettledSet": { "presentmentMoney": { "amount": "0.0", "currencyCode": "USD" }, "shopMoney": { "amount": "0.0", "currencyCode": "USD" } }, "user": null } ] } } } ### Retrieves fulfillments associated with an order Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"query FulfillmentList($orderId: ID!) { order(id: $orderId) { fulfillments(first: 10) { fulfillmentLineItems(first: 10) { edges { node { id lineItem { title variant { id } } quantity originalTotalSet { shopMoney { amount currencyCode } } } } } status estimatedDeliveryAt location { id legacyResourceId } service { handle } trackingInfo(first: 10) { company number url } originAddress { address1 address2 city countryCode provinceCode zip } } } }\",\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query FulfillmentList($orderId: ID!) {\n order(id: $orderId) {\n fulfillments(first: 10) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\n }`,\n \"variables\": {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n query FulfillmentList($orderId: ID!) {\n order(id: $orderId) {\n fulfillments(first: 10) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"orderId\": \"gid://shopify/Order/148977776\"\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query FulfillmentList($orderId: ID!) {\n order(id: $orderId) {\n fulfillments(first: 10) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\n }`,\n {\n variables: {\n \"orderId\": \"gid://shopify/Order/148977776\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query FulfillmentList($orderId: ID!) {\n order(id: $orderId) {\n fulfillments(first: 10) {\n fulfillmentLineItems(first: 10) {\n edges {\n node {\n id\n lineItem {\n title\n variant {\n id\n }\n }\n quantity\n originalTotalSet {\n shopMoney {\n amount\n currencyCode\n }\n }\n }\n }\n }\n status\n estimatedDeliveryAt\n location {\n id\n legacyResourceId\n }\n service {\n handle\n }\n trackingInfo(first: 10) {\n company\n number\n url\n }\n originAddress {\n address1\n address2\n city\n countryCode\n provinceCode\n zip\n }\n }\n }\n}" #### Graphql Input { "orderId": "gid://shopify/Order/148977776" } #### Graphql Response { "data": { "order": { "fulfillments": [] } } }