# The order-level discount applied to a draft order.
type DraftOrderAppliedDiscount {
    # The amount of money discounted, with values shown in both shop currency and presentment currency.
    amountSet: MoneyBag!

    # Amount of money discounted.
    amountV2: MoneyV2!

    # Description of the order-level discount.
    description: String!

    # Name of the order-level discount.
    title: String

    # The order level discount amount. If valueType is "percentage",
    # then value is the percentage discount.
    value: Float!

    # Type of the order-level discount.
    valueType: DraftOrderAppliedDiscountType!
}

# A line item included in a draft order.
type DraftOrderLineItem implements Node {
    # The discount that will be applied to the line item or the overall order.
    appliedDiscount: DraftOrderAppliedDiscount

    # Whether the line item is a custom line item (true) or a product variant line item (false).
    custom: Boolean!

    # A list of attributes that represent custom features or special requests.
    customAttributes: [Attribute!]!

    # Additional information (metafields) about the line item with the associated types.
    customAttributesV2: [TypedAttribute!]!

    # The line item price after discounts are applied.
    discountedTotal: Money!

    # The line item price after discounts are applied.
    discountedTotalSet: MoneyBag!

    # The discountedTotal divided by quantity, resulting in the value of the discount per unit.
    discountedUnitPrice: Money!

    # The discountedTotal divided by quantity, resulting in the value of the discount per unit.
    discountedUnitPriceSet: MoneyBag!

    # Name of the service provider who fulfilled the order.
    #
    # Valid values are either manual or the name of the provider.
    # For example, amazon, shipwire.
    #
    # Deleted fulfillment services will return null.
    fulfillmentService: FulfillmentService

    # A globally-unique identifier.
    id: ID!

    # The image associated with the draft order line item.
    image: Image

    # Whether the line item is a gift card.
    isGiftCard: Boolean!

    # The name of the product.
    name: String!

    # The total price (without discounts) of the line item, based on the original unit price of the variant x quantity.
    originalTotal: Money!

    # The total price (without discounts) of the line item,based on the original unit price of the variant x quantity.
    originalTotalSet: MoneyBag!

    # The variant price without any discounts applied.
    originalUnitPrice: Money!

    # The variant price without any discounts applied.
    originalUnitPriceSet: MoneyBag!

    # The product corresponding to the line item’s product variant.
    product: Product

    # The number of product variants that are requested in the draft order.
    quantity: Int!

    # Whether physical shipping is required for the variant.
    requiresShipping: Boolean!

    # The SKU number of the product variant.
    sku: String

    # A list of tax line objects, each of which details the total taxes applicable to the order.
    taxLines: [TaxLine!]!

    # Whether the variant is taxable.
    taxable: Boolean!

    # The title of the product or variant. This field only applies to custom line items.
    title: String!

    # The total value of the discount that is applied to the line item.
    totalDiscount: Money!

    # The total value of the discount that is applied to the line item.
    totalDiscountSet: MoneyBag!

    # The associated variant for the line item.
    variant: ProductVariant

    # The name of the variant.
    variantTitle: String

    # The name of the vendor who created the product variant.
    vendor: String

    # The weight unit and value for a draft order line item.
    weight: Weight
}

# Represents the payment schedule for a single payment defined in the payment terms.
type PaymentSchedule implements Node {
    # Amount owed for this payment schedule.
    amount: MoneyV2!

    # Date and time when the payment schedule is paid or fulfilled.
    completedAt: DateTime

    # Date and time when the payment schedule is due.
    dueAt: DateTime

    # A globally-unique identifier.
    id: ID!

    # Date and time when the invoice is sent.
    issuedAt: DateTime
}

# Represents the payment terms for an order or draft order.
type PaymentTerms implements Node {
    # Duration of payment terms in days based on the payment terms template used to create the payment terms.
    dueInDays: Int

    # A globally-unique identifier.
    id: ID!

    # Whether the payment terms have overdue payment schedules.
    overdue: Boolean!

    # List of schedules for the payment terms.
    paymentSchedules(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): PaymentScheduleConnection!

    # The name of the payment terms template used to create the payment terms.
    paymentTermsName: String!

    # The payment terms template type used to create the payment terms.
    paymentTermsType: PaymentTermsType!

    # The payment terms name, translated into the shop admin's preferred language.
    translatedName: String!
}

# Represents a selling method (for example, "Subscribe and save" or "Pre-paid"). Selling plan groups
# and associated records (selling plans and policies) are deleted 48 hours after a merchant
# uninstalls their subscriptions app. We recommend backing up these records if you need to restore them later.
type SellingPlanGroup implements Node {
    # The identifier for app, exposed in Liquid and product JSON.
    appId: String

    # Whether the given product is directly associated to the selling plan group.
    appliesToProduct(productId: ID!): Boolean!

    # Whether the given product variant is directly associated to the selling plan group.
    appliesToProductVariant(productVariantId: ID!): Boolean!

    # Whether any of the product variants of the given product are associated to the selling plan group.
    appliesToProductVariants(productId: ID!): Boolean!

    # The date and time when the selling plan group was created.
    createdAt: DateTime!

    # The merchant-facing description of the selling plan group.
    description: String

    # A globally-unique identifier.
    id: ID!

    # The merchant-facing label of the selling plan group.
    merchantCode: String!

    # The buyer-facing label of the selling plan group.
    name: String!

    # The values of all options available on the selling plan group. Selling plans are grouped together in Liquid when they are created by the same app, and have the same selling_plan_group.name and selling_plan_group.options values.
    options: [String!]!

    # The relative position of the selling plan group for display.
    position: Int

    # A count of products associated to the selling plan group.
    productCount: Int!

    # A count of product variants associated to the selling plan group.
    productVariantCount(productId: ID): Int!

    # Product variants associated to the selling plan group.
    productVariants(
        productId: ID
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): ProductVariantConnection!

    # Products associated to the selling plan group.
    products(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): ProductConnection!

    # Selling plans associated to the selling plan group.
    sellingPlans(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): SellingPlanConnection!

    # A summary of the policies associated to the selling plan group.
    summary: String
}

# Represents how a product can be sold and purchased. Selling plans and associated records (selling plan groups
# and policies) are deleted 48 hours after a merchant uninstalls their subscriptions app. We recommend backing
# up these records if you need to restore them later.
#
# For more information on selling plans, refer to
# Creating and managing selling plans.
type SellingPlan implements Node {
    # A selling plan policy which describes the recurring billing details.
    billingPolicy: SellingPlanBillingPolicy!

    # The category used to classify the selling plan for reporting purposes.
    category: SellingPlanCategory

    # The date and time when the selling plan was created.
    createdAt: DateTime!

    # A selling plan policy which describes the delivery details.
    deliveryPolicy: SellingPlanDeliveryPolicy!

    # Buyer facing string which describes the selling plan commitment.
    description: String

    # A globally-unique identifier.
    id: ID!

    # When to reserve inventory for a selling plan.
    inventoryPolicy: SellingPlanInventoryPolicy

    # A customer-facing description of the selling plan.
    #
    # If your store supports multiple currencies, then don't include country-specific pricing content,
    # such as "Buy monthly, get 10$ CAD off". This field won't be converted to reflect different currencies.
    name: String!

    # The values of all options available on the selling plan.
    # Selling plans are grouped together in Liquid when they are created by the same app,
    # and have the same selling_plan_group.name and selling_plan_group.options values.
    options: [String!]!

    # Relative position of the selling plan for display. A lower position will be displayed before a higher position.
    position: Int

    # Selling plan pricing details.
    pricingPolicies: [SellingPlanPricingPolicy!]!
}

# The selling plan inventory policy.
type SellingPlanInventoryPolicy {
    # When to reserve inventory for the order.
    reserve: SellingPlanReserve!
}

# A payment transaction in the context of an order.
type OrderTransaction implements Node {
    # The masked account number associated with the payment method.
    accountNumber: String

    # The amount and currency of the transaction in shop and presentment currencies.
    amountSet: MoneyBag!

    authorizationCode: String
    # Authorization code associated with the transaction.

    # The time when the authorization expires. This field is available only to stores on a Shopify Plus plan and is populated only for Shopify Payments authorizations.
    authorizationExpiresAt: DateTime

    # Date and time when the transaction was created.
    createdAt: DateTime!

    # A standardized error code, independent of the payment provider.
    errorCode: OrderTransactionErrorCode

    # The transaction fees charged on the order transaction. Only present for Shopify Payments transactions.
    fees: [TransactionFee!]!

    # The human-readable payment gateway name used to process the transaction.
    formattedGateway: String

    # The payment gateway used to process the transaction.
    gateway: String

    # A globally-unique identifier.
    id: ID!

    # The kind of transaction.
    kind: OrderTransactionKind!

    # Whether the transaction can be manually captured.
    manuallyCapturable: Boolean!

    # Specifies the available amount with currency to refund on the gateway.
    # This value is only available for transactions of type SuggestedRefund.
    maximumRefundableV2: MoneyV2

    # The associated order.
    order: Order

    # The associated parent transaction, for example the authorization of a capture.
    parentTransaction: OrderTransaction

    # The payment icon to display for the transaction.
    paymentIcon: Image

    # Date and time when the transaction was processed.
    processedAt: DateTime

    # The transaction receipt that the payment gateway attaches to the transaction.
    # The value of this field depends on which payment gateway processed the transaction.
    receiptJson: JSON

    # The settlement currency.
    settlementCurrency: CurrencyCode

    # The rate used when converting the transaction amount to settlement currency.
    settlementCurrencyRate: Decimal

    # Contains all Shopify Payments information related to an order transaction.
    # This field is available only to stores on a Shopify Plus plan.
    shopifyPaymentsSet: ShopifyPaymentsTransactionSet

    # The status of this transaction.
    status: OrderTransactionStatus!

    # Whether the transaction is a test transaction.
    test: Boolean!

    # Specifies the available amount with currency to capture on the gateway in shop and presentment currencies.
    # Only available when an amount is capturable or manually mark as paid.
    totalUnsettledSet: MoneyBag

    # Staff member who was logged into the Shopify POS device when the transaction was processed.
    user: StaffMember
}

# Transaction fee related to an order transaction.
type TransactionFee implements Node {
    # Amount of the fee.
    amount: MoneyV2!

    # Flat rate charge for a transaction.
    flatFee: MoneyV2!

    # Name of the credit card flat fee.
    flatFeeName: String

    # A globally-unique identifier.
    id: ID!

    # Percentage charge.
    rate: Decimal!

    # Name of the credit card rate.
    rateName: String

    # Tax amount charged on the fee.
    taxAmount: MoneyV2!

    # Name of the type of fee.
    type: String!
}

# Presents all Shopify Payments specific information related to an order transaction.
type ShopifyPaymentsTransactionSet {
    # Contains all fields related to an extended authorization.
    extendedAuthorizationSet: ShopifyPaymentsExtendedAuthorization

    # Contains all fields related to a refund.
    refundSet: ShopifyPaymentsRefundSet
}

# Presents all Shopify Payments specific information related to an order refund.
type ShopifyPaymentsRefundSet {
    # The acquirer reference number (ARN) code generated for Visa/Mastercard transactions.
    acquirerReferenceNumber: String
}

# Presents all Shopify Payments information related to an extended authorization.
type ShopifyPaymentsExtendedAuthorization {
    # The time after which the extended authorization expires.
    # After the expiry, the merchant is unable to capture the payment.
    extendedAuthorizationExpiresAt: DateTime!

    # The time after which capture will incur an additional fee.
    standardAuthorizationExpiresAt: DateTime!
}

# Represents a refund suggested by Shopify based on the items being reimbursed.
# You can then use the suggested refund object to generate an actual refund.
type SuggestedRefund {
    # The total monetary value to be refunded in shop and presentment currencies.
    amountSet: MoneyBag!

    # The sum of all the discounted prices of the line items being refunded.
    discountedSubtotalSet: MoneyBag!

    # The total monetary value available to refund in shop and presentment currencies.
    maximumRefundableSet: MoneyBag!

    # A list of duties to be refunded from the order.
    refundDuties: [RefundDuty!]!

    # A list of line items to be refunded, along with restock instructions.
    refundLineItems: [RefundLineItem!]!

    # The shipping costs to be refunded from the order.
    shipping: ShippingRefund!

    # The sum of all the prices of the line items being refunded in shop and presentment currencies.
    subtotalSet: MoneyBag!

    # A list of suggested order transactions.
    suggestedTransactions: [SuggestedOrderTransaction!]!

    # The total cart discount amount that was applied to all line items in this refund.
    totalCartDiscountAmountSet: MoneyBag!

    # The sum of all the duties being refunded from the order in shop and presentment currencies. The value must be positive.
    totalDutiesSet: MoneyBag!

    # The sum of the taxes being refunded from the order in shop and presentment currencies. The value must be positive.
    totalTaxSet: MoneyBag!
}

# A suggested transaction. Suggested transaction are usually used in the context of refunds
# and exchanges.
type SuggestedOrderTransaction {
    # The masked account number associated with the payment method.
    accountNumber: String

    # The amount and currency of the suggested order transaction in shop and presentment currencies.
    amountSet: MoneyBag!

    # The human-readable payment gateway name suggested to process the transaction.
    formattedGateway: String

    # The suggested payment gateway used to process the transaction.
    gateway: String

    # Specifies the kind of the suggested order transaction.
    kind: SuggestedOrderTransactionKind!

    # Specifies the available amount to refund on the gateway in shop and presentment currencies. Only available within SuggestedRefund.
    maximumRefundableSet: MoneyBag

    # The associated parent transaction, for example the authorization of a capture.
    parentTransaction: OrderTransaction
}

# Represents the shipping costs refunded on the Refund.
type ShippingRefund {
    # The monetary value of the shipping fees to be refunded in shop and presentment currencies.
    amountSet: MoneyBag!

    # The maximum amount of shipping fees currently refundable in shop and presentment currencies.
    maximumRefundableSet: MoneyBag!

    # The monetary value of the tax allocated to shipping fees to be refunded in shop and presentment currencies.
    taxSet: MoneyBag!
}

# A line item that's included in a refund.
type RefundLineItem {
    # The LineItem resource associated to the refunded line item.
    lineItem: LineItem!

    # The inventory restock location.
    location: Location

    # The price of a refunded line item in shop and presentment currencies.
    priceSet: MoneyBag!

    # The quantity of a refunded line item.
    quantity: Int!

    # The type of restock for the refunded line item.
    restockType: RefundLineItemRestockType!

    # Whether the refunded line item was restocked. Not applicable in the context of a SuggestedRefund.
    restocked: Boolean!

    # The subtotal price of a refunded line item in shop and presentment currencies.
    subtotalSet: MoneyBag!

    # The total tax charged on a refunded line item in shop and presentment currencies.
    totalTaxSet: MoneyBag!
}

type LineItem implements Node {
    # The subscription contract associated with this line item.
    contract: SubscriptionContract

    # The line item's quantity, minus the removed quantity.
    currentQuantity: Int!

    # A list of attributes that represent custom features or special requests.
    customAttributes: [Attribute!]!

    # The discounts that have been allocated onto the line item by discount applications.
    discountAllocations: [DiscountAllocation!]!

    # The total line price after discounts are applied, in shop and presentment currencies.
    discountedTotalSet: MoneyBag!

    # The approximate split price of a line item unit, in shop and presentment currencies.
    # This value doesn't include discounts applied to the entire order.
    discountedUnitPriceSet: MoneyBag!

    # The duties associated with the line item.
    duties: [Duty!]!

    # A globally-unique identifier.
    id: ID!

    # The image associated to the line item's variant.
    image: Image

    # Whether the line item can be edited or not.
    merchantEditable: Boolean!

    # The name of the product.
    name: String!

    # The total number of units that can't be fulfilled.
    # For example, if items have been refunded, or the item is not something that can be fulfilled,
    # like a tip.Please see the FulfillmentOrder object for more fulfillment details.
    nonFulfillableQuantity: Int!

    # The total price in shop and presentment currencies, without discounts applied.
    # This value is based on the unit price of the variant x quantity.
    originalTotalSet: MoneyBag!

    # The variant unit price without discounts applied, in shop and presentment currencies.
    originalUnitPriceSet: MoneyBag!

    # The Product object associated with this line item's variant.
    product: Product

    # The number of variant units ordered.
    quantity: Int!

    # The line item's quantity, minus the removed quantity.
    refundableQuantity: Int!

    # Whether physical shipping is required for the variant.
    requiresShipping: Boolean!

    # Whether the line item can be restocked.
    restockable: Boolean!

    # The selling plan details associated with the line item.
    sellingPlan: LineItemSellingPlan

    sku: String
    # The variant SKU number.

    # Staff attributed to the initial sale of the line item.
    staffMember: StaffMember

    # The taxes charged for this line item.
    taxLines(first: Int): [TaxLine!]!

    # Whether the variant is taxable.
    taxable: Boolean!

    # The title of the product.
    title: String!

    # The total amount of the discount that's allocated to the line item, in the shop and presentment currencies.
    # This field must be explicitly set using draft orders, Shopify scripts, or the API.
    totalDiscountSet: MoneyBag!

    # The total discounted value of unfulfilled units, in shop and presentment currencies.
    unfulfilledDiscountedTotalSet: MoneyBag!

    # The total price, without any discounts applied.
    # This value is based on the unit price of the variant x quantity of all unfulfilled units, in shop and presentment currencies.
    unfulfilledOriginalTotalSet: MoneyBag!

    # The number of units not yet fulfilled.
    unfulfilledQuantity: Int!

    # The Variant object associated with this line item.
    variant: ProductVariant

    # The name of the variant.
    variantTitle: String

    # The name of the vendor who made the variant.
    vendor: String
}

# Custom subscription discount.
type SubscriptionManualDiscount {
    # Entitled line items used to apply the subscription discount on.
    entitledLines: SubscriptionDiscountEntitledLines!

    # The unique identifier.
    id: ID!

    # The maximum number of times the subscription discount will be applied on orders.
    recurringCycleLimit: Int

    # The reason that the discount on the subscription draft is rejected.
    rejectionReason: SubscriptionDiscountRejectionReason

    # Type of line the discount applies on.
    targetType: DiscountTargetType!

    # The title associated with the subscription discount.
    title: String

    # The type of the subscription discount.
    type: DiscountType!

    # The number of times the discount was applied.
    usageCount: Int!

    # The value of the subscription discount.
    value: SubscriptionDiscountValue!
}

# Represents the subscription lines the discount applies on.
type SubscriptionDiscountEntitledLines {
    # Specify whether the subscription discount will apply on all subscription lines.
    all: Boolean!

    # The list of subscription lines associated with the subscription discount.
    lines(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): SubscriptionLineConnection!
}

# Represents a Subscription Line.
type SubscriptionLine {
    # The price per unit for the subscription line in the contract's currency.
    currentPrice: MoneyV2!

    # List of custom attributes associated to the line item.
    customAttributes: [Attribute!]!

    # Discount allocations.
    discountAllocations: [SubscriptionDiscountAllocation!]!

    # The unique identifier.
    id: ID!

    # Total line price including all discounts.
    lineDiscountedPrice: MoneyV2!

    # Describe the price changes of the line over time.
    pricingPolicy: SubscriptionPricingPolicy

    # The product id associated with the subscription line.
    productId: ID

    # The quantity of the unit selected for the subscription line.
    quantity: Int!

    # Whether physical shipping is required for the variant.
    requiresShipping: Boolean!

    # The selling plan ID associated to the line.
    #
    # Indicates which selling plan was used to create this
    # contract line initially. The selling plan ID is also used to
    # find the associated delivery profile.
    #
    # The subscription contract, subscription line, or selling plan might have
    # changed. As a result, the selling plan's attributes might not
    # match the information on the contract.
    sellingPlanId: ID

    # The selling plan name associated to the line. This name describes
    # the order line items created from this subscription line
    # for both merchants and customers.
    #
    # The value can be different from the selling plan's name, because both
    # the selling plan's name and the subscription line's selling_plan_name
    # attribute can be updated independently.
    sellingPlanName: String

    # Variant SKU number of the item associated with the subscription line.
    sku: String

    # Whether the variant is taxable.
    taxable: Boolean!

    # Product title of the item associated with the subscription line.
    title: String!

    # The product variant id associated with the subscription line.
    variantId: ID

    # The image associated with the line item's variant or product.
    variantImage: Image

    # Product variant title of the item associated with the subscription line.
    variantTitle: String
}

# Represents a Subscription Delivery Policy.
type SubscriptionDeliveryPolicy {
    # The specific anchor dates upon which the delivery interval calculations should be made.
    anchors: [SellingPlanAnchor!]!

    # The kind of interval that is associated with this schedule (e.g. Monthly, Weekly, etc).
    interval: SellingPlanInterval!

    # The number of delivery intervals between deliveries.
    intervalCount: Int!
}

# Represents a Subscription Billing Policy.
type SubscriptionBillingPolicy {
    # Specific anchor dates upon which the billing interval calculations should be made.
    anchors: [SellingPlanAnchor!]!

    # The kind of interval that is associated with this schedule (e.g. Monthly, Weekly, etc).
    interval: SellingPlanInterval!

    # The number of billing intervals between invoices.
    intervalCount: Int!

    # Maximum amount of cycles after which the subscription ends.
    maxCycles: Int

    # Minimum amount of cycles required in the subscription.
    minCycles: Int
}

# Represents a selling plan policy anchor.
type SellingPlanAnchor {
    # The cutoff day for the anchor.
    #
    # If type is WEEKDAY, then the value must be between 1-7. Shopify interprets
    # the days of the week according to ISO 8601, where 1 is Monday.
    #
    # If type is MONTHDAY, then the value must be between 1-31.
    #
    # If type is YEARDAY, then the value must be null.
    cutoffDay: Int

    # The day of the anchor.
    #
    # If type is WEEKDAY, then the value must be between 1-7. Shopify interprets
    # the days of the week according to ISO 8601, where 1 is Monday.
    #
    # If type is not WEEKDAY, then the value must be between 1-31.
    day: Int!

    # The month of the anchor. If type is different than YEARDAY, then the value must
    # be null or between 1-12.
    month: Int

    # Represents the anchor type, it can be one one of WEEKDAY, MONTHDAY, YEARDAY.
    type: SellingPlanAnchorType!
}

# Represents a Subscription Line Pricing Policy.
type SubscriptionPricingPolicy {
    # The base price per unit for the subscription line in the contract's currency.
    basePrice: MoneyV2!

    # The adjustments per cycle for the subscription line.
    cycleDiscounts: [SubscriptionCyclePriceAdjustment!]!
}

# Represents a Subscription Line Pricing Cycle Adjustment.
type SubscriptionCyclePriceAdjustment {
    # Price adjustment type.
    adjustmentType: SellingPlanPricingPolicyAdjustmentType!

    # Price adjustment value.
    adjustmentValue: SellingPlanPricingPolicyAdjustmentValue!

    # The number of cycles required before this pricing policy applies.
    afterCycle: Int!

    # The computed price after the adjustments applied.
    computedPrice: MoneyV2!
}

# Represents what a particular discount reduces from a line price.
type SubscriptionDiscountAllocation {
    # Allocation amount.
    amount: MoneyV2!

    # Discount that created the allocation.
    discount: SubscriptionDiscount!
}

# Represents the selling plan for a line item.
type LineItemSellingPlan {
    # The name of the selling plan for display purposes.
    name: String!

    # The ID of the selling plan associated with the line item.
    sellingPlanId: ID
}

type Duty implements Node {
    # The ISO 3166-1 alpha-2 country code of the country of origin used in calculating the duty.
    countryCodeOfOrigin: CountryCode

    # The harmonized system code of the item used in calculating the duty.
    harmonizedSystemCode: String

    # A globally-unique identifier.
    id: ID!

    # The amount of the duty.
    price: MoneyBag!

    # A list of taxes charged on the duty.
    taxLines: [TaxLine!]!
}

# Represents a refunded duty.
type RefundDuty {
    # The amount of a refunded duty in shop and presentment currencies.
    amountSet: MoneyBag!

    # The duty associated with this refunded duty.
    originalDuty: Duty
}

# The record of the line items and transactions that were refunded to a customer,
# along with restocking instructions for refunded line items.
type Refund implements LegacyInteroperability&Node {
    # The date and time when the refund was created.
    createdAt: DateTime

    # A list of the refunded duties as part of this refund.
    duties: [RefundDuty!]

    # A globally-unique identifier.
    id: ID!

    # The ID of the corresponding resource in the REST Admin API.
    legacyResourceId: UnsignedInt64!

    # The optional note associated with the refund.
    note: String

    # The order associated with the refund.
    order: Order!

    # The RefundLineItem resources attached to the refund.
    refundLineItems(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): RefundLineItemConnection!

    # The staff member who created the refund.
    staffMember: StaffMember

    # The total amount across all transactions for the refund, in shop and presentment currencies.
    totalRefundedSet: MoneyBag!

    # The transactions associated with the refund.
    transactions(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): OrderTransactionConnection!

    # The date and time when the refund was updated.
    updatedAt: DateTime!
}

# Represents a fraud check on an order.
type OrderRisk {
    # Whether the risk level is shown in the Shopify admin.
    # If false, then this order risk is ignored when Shopify determines the overall risk level for the order.
    display: Boolean!

    # The likelihood that an order is fraudulent, based on this order risk.
    #
    # The level can be set by Shopify risk analysis or by an app.
    level: OrderRiskLevel

    # The risk message that's shown to the merchant in the Shopify admin.
    message: String
}

# The payment collection details for an order that requires additional payment following an edit to the order.
type OrderPaymentCollectionDetails {
    # The URL to use for collecting an additional payment on the order.
    additionalPaymentCollectionUrl: URL

    # The list of vaulted payment methods for the order with their permissions.
    vaultedPaymentMethods: [PaymentMandate!]
}

# A payment instrument and the permission
# the owner of the instrument gives to the merchant to debit it.
type PaymentMandate implements Node {
    # The unique identifier of a payment mandate.
    id: ID!

    # The outputs details of the payment instrument.
    paymentInstrument: PaymentInstrument!
}

# The fields required to reimburse duties on a refund.
input RefundDutyInput {
    # The ID of the duty in the refund.
    dutyId: ID!

    # The type of refund for this duty.
    refundType: RefundDutyRefundType
}

# The fields required to reimburse line items on a refund.
input RefundLineItemInput {
    # The ID of the line item in the refund.
    lineItemId: ID!

    # The quantity of the associated line item to be refunded.
    quantity: Int!

    # The type of restock for this line item.
    restockType: RefundLineItemRestockType

    # The intended location for restocking. If the restockType is set to NO_RESTOCK, then this value is empty.`
    locationId: ID
}

# A summary of the important details for a dispute on an order.
type OrderDisputeSummary implements Node {
    # A globally-unique identifier.
    id: ID!

    # The type that the dispute was initiated as.
    initiatedAs: DisputeType!

    # The current status of the dispute.
    status: DisputeStatus!
}

# The tax allocated to a sale from a single tax line.
type SaleTax {
    # The portion of the total tax amount on the related sale that comes from the associated tax line.
    amount: MoneyBag!

    # The unique identifier for the sale tax.
    id: ID!

    # The tax line associated with the sale.
    taxLine: TaxLine!
}

# A record of an execution of the subscription billing process. Billing attempts use
#idempotency keys to avoid duplicate order creation. A successful billing attempt
#will create an order.
type SubscriptionBillingAttempt implements Node {
    # The date and time when the billing attempt was completed.
    completedAt: DateTime

    # The date and time when the billing attempt was created.
    createdAt: DateTime!

    # A code corresponding to a payment error during processing.
    errorCode: SubscriptionBillingAttemptErrorCode

    # A message describing a payment error during processing.
    errorMessage: String

    # A globally-unique identifier.
    id: ID!

    # A unique key generated by the client to avoid duplicate payments.
    idempotencyKey: String!

    # The URL where the customer needs to be redirected so they can complete the 3D Secure payment flow.
    nextActionUrl: URL

    # The result of this billing attempt if completed successfully.
    order: Order

    # The date and time used to calculate fulfillment intervals for a billing attempt that
    # successfully completed after the current anchor date. To prevent fulfillment from being
    # pushed to the next anchor date, this field can override the billing attempt date.
    originTime: DateTime

    # Whether the billing attempt is still processing.
    ready: Boolean!

    # The subscription contract.
    subscriptionContract: SubscriptionContract!
}

# Represents the payment terms template object.
type PaymentTermsTemplate implements Node {
    # The description of the payment terms template.
    description: String!

    # The number of days between the issued date and due date if this is the net type of payment terms.
    dueInDays: Int

    # A globally-unique identifier.
    id: ID!

    # The name of the payment terms template.
    name: String!

    # The type of the payment terms template.
    paymentTermsType: PaymentTermsType!

    # The translated payment terms template name.
    translatedName: String!
}

# The fixed selling plan billing policy.
type SellingPlanFixedBillingPolicy {
    # The checkout charge when the full amount isn't charged at checkout.
    checkoutCharge: SellingPlanCheckoutCharge!

    # The exact time when to capture the full payment.
    remainingBalanceChargeExactTime: DateTime

    # The period after remaining_balance_charge_trigger, before capturing the full payment.
    # Expressed as an ISO8601 duration.
    remainingBalanceChargeTimeAfterCheckout: String

    # When to capture payment for amount due.
    remainingBalanceChargeTrigger: SellingPlanRemainingBalanceChargeTrigger!
}

# The amount charged at checkout when the full amount isn't charged at checkout.
type SellingPlanCheckoutCharge {
    # The charge type for the checkout charge.
    type: SellingPlanCheckoutChargeType!

    # The charge value for the checkout charge.
    value: SellingPlanCheckoutChargeValue!
}

# Represents a recurring selling plan billing policy.
type SellingPlanRecurringBillingPolicy {
    # Specific anchor dates upon which the billing interval calculations should be made.
    anchors: [SellingPlanAnchor!]!

    # The date and time when the selling plan billing policy was created.
    createdAt: DateTime!

    # The billing frequency, it can be either: day, week, month or year.
    interval: SellingPlanInterval!

    # The number of intervals between billings.
    intervalCount: Int!

    # Maximum number of billing iterations.
    maxCycles: Int

    # Minimum number of billing iterations.
    minCycles: Int
}

# Represents a fixed selling plan delivery policy.
type SellingPlanFixedDeliveryPolicy {
    # The specific anchor dates upon which the delivery interval calculations should be made.
    anchors: [SellingPlanAnchor!]!

    # A buffer period for orders to be included in next fulfillment anchor.
    cutoff: Int

    # The date and time when the fulfillment should trigger.
    fulfillmentExactTime: DateTime

    # What triggers the fulfillment. The value must be one of ANCHOR, ASAP, EXACT_TIME, or UNKNOWN.
    fulfillmentTrigger: SellingPlanFulfillmentTrigger!

    # Whether the delivery policy is merchant or buyer-centric.
    # Buyer-centric delivery policies state the time when the buyer will receive the goods.
    # Merchant-centric delivery policies state the time when the fulfillment should be started.
    # Currently, only merchant-centric delivery policies are supported.
    intent: SellingPlanFixedDeliveryPolicyIntent!

    # The fulfillment or delivery behavior of the first fulfillment when the order is placed before the anchor.
    # The default value for this field is ASAP.
    preAnchorBehavior: SellingPlanFixedDeliveryPolicyPreAnchorBehavior!
}

# Represents a recurring selling plan delivery policy.
type SellingPlanRecurringDeliveryPolicy {
    # The specific anchor dates upon which the delivery interval calculations should be made.
    anchors: [SellingPlanAnchor!]!

    # The date and time when the selling plan delivery policy was created.
    createdAt: DateTime!

    # A buffer period for orders to be included in a cycle.
    cutoff: Int

    # Whether the delivery policy is merchant or buyer-centric.
    # Buyer-centric delivery policies state the time when the buyer will receive the goods.
    # Merchant-centric delivery policies state the time when the fulfillment should be started.
    # Currently, only merchant-centric delivery policies are supported.
    intent: SellingPlanRecurringDeliveryPolicyIntent!

    # The delivery frequency, it can be either: day, week, month or year.
    interval: SellingPlanInterval!

    # The number of intervals between deliveries.
    intervalCount: Int!

    # The fulfillment or delivery behavior of the first fulfillment when the order is placed before the anchor.
    # The default value for this field is ASAP.
    preAnchorBehavior: SellingPlanRecurringDeliveryPolicyPreAnchorBehavior!
}

# The percentage value of the price used for checkout charge.
type SellingPlanCheckoutChargePercentageValue {
    # The percentage value of the price used for checkout charge.
    percentage: Float!
}

# Represents a fixed selling plan pricing policy.
type SellingPlanFixedPricingPolicy implements SellingPlanPricingPolicyBase {
    # The price adjustment type.
    adjustmentType: SellingPlanPricingPolicyAdjustmentType!

    # The price adjustment value.
    adjustmentValue: SellingPlanPricingPolicyAdjustmentValue!

    # The date and time when the fixed selling plan pricing policy was created.
    createdAt: DateTime!
}

# Represents a recurring selling plan pricing policy.
type SellingPlanRecurringPricingPolicy implements SellingPlanPricingPolicyBase {
    # The price adjustment type.
    adjustmentType: SellingPlanPricingPolicyAdjustmentType!

    # The price adjustment value.
    adjustmentValue: SellingPlanPricingPolicyAdjustmentValue!

    # Cycle after which this pricing policy applies.
    afterCycle: Int

    # The date and time when the recurring selling plan pricing policy was created.
    createdAt: DateTime!
}

# An auto-generated type for paginating through multiple Orders.
type OrderConnection {
    # A list of edges.
    edges: [OrderEdge!]!

    # A list of the nodes contained in OrderEdge.
    nodes: [Order!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one Order and a cursor during pagination.
type OrderEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of OrderEdge.
    node: Order!
}

# An auto-generated type for paginating through multiple CustomerPaymentMethods.
type CustomerPaymentMethodConnection {
    # A list of edges.
    edges: [CustomerPaymentMethodEdge!]!

    # A list of the nodes contained in CustomerPaymentMethodEdge.
    nodes: [CustomerPaymentMethod!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one CustomerPaymentMethod and a cursor during pagination.
type CustomerPaymentMethodEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of CustomerPaymentMethodEdge.
    node: CustomerPaymentMethod!
}

# An auto-generated type for paginating through multiple SubscriptionContracts.
type SubscriptionContractConnection {
    # A list of edges.
    edges: [SubscriptionContractEdge!]!

    # A list of the nodes contained in SubscriptionContractEdge.
    nodes: [SubscriptionContract!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one SubscriptionContract and a cursor during pagination.
type SubscriptionContractEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of SubscriptionContractEdge.
    node: SubscriptionContract!
}

# An auto-generated type for paginating through multiple SubscriptionManualDiscounts.
type SubscriptionManualDiscountConnection {
    # A list of edges.
    edges: [SubscriptionManualDiscountEdge!]!

    # A list of the nodes contained in SubscriptionManualDiscountEdge.
    nodes: [SubscriptionManualDiscount!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one SubscriptionManualDiscount and a cursor during pagination.
type SubscriptionManualDiscountEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of SubscriptionManualDiscountEdge.
    node: SubscriptionManualDiscount!
}

# An auto-generated type for paginating through multiple SubscriptionLines.
type SubscriptionLineConnection {
    # A list of edges.
    edges: [SubscriptionLineEdge!]!

    # A list of the nodes contained in SubscriptionLineEdge.
    nodes: [SubscriptionLine!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one SubscriptionLine and a cursor during pagination.
type SubscriptionLineEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of SubscriptionLineEdge.
    node: SubscriptionLine!
}

# An auto-generated type for paginating through multiple AppPurchaseOneTimes.
type AppPurchaseOneTimeConnection {
    # A list of edges.
    edges: [AppPurchaseOneTimeEdge!]!

    # A list of the nodes contained in AppPurchaseOneTimeEdge.
    nodes: [AppPurchaseOneTime!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one AppPurchaseOneTime and a cursor during pagination.
type AppPurchaseOneTimeEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of AppPurchaseOneTimeEdge.
    node: AppPurchaseOneTime!
}

# An auto-generated type for paginating through multiple SubscriptionBillingAttempts.
type SubscriptionBillingAttemptConnection {
    # A list of edges.
    edges: [SubscriptionBillingAttemptEdge!]!

    # A list of the nodes contained in SubscriptionBillingAttemptEdge.
    nodes: [SubscriptionBillingAttempt!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one SubscriptionBillingAttempt and a cursor during pagination.
type SubscriptionBillingAttemptEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of SubscriptionBillingAttemptEdge.
    node: SubscriptionBillingAttempt!
}

# An auto-generated type for paginating through multiple DraftOrders.
type DraftOrderConnection {
    # A list of edges.
    edges: [DraftOrderEdge!]!

    # A list of the nodes contained in DraftOrderEdge.
    nodes: [DraftOrder!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one DraftOrder and a cursor during pagination.
type DraftOrderEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of DraftOrderEdge.
    node: DraftOrder!
}

# An auto-generated type for paginating through multiple PaymentSchedules.
type PaymentScheduleConnection {
    # A list of edges.
    edges: [PaymentScheduleEdge!]!

    # A list of the nodes contained in PaymentScheduleEdge.
    nodes: [PaymentSchedule!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one PaymentSchedule and a cursor during pagination.
type PaymentScheduleEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of PaymentScheduleEdge.
    node: PaymentSchedule!
}

# An auto-generated type for paginating through multiple SellingPlans.
type SellingPlanConnection {
    # A list of edges.
    edges: [SellingPlanEdge!]!

    # A list of the nodes contained in SellingPlanEdge.
    nodes: [SellingPlan!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one SellingPlan and a cursor during pagination.
type SellingPlanEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of SellingPlanEdge.
    node: SellingPlan!
}

# An auto-generated type for paginating through multiple RefundLineItems.
type RefundLineItemConnection {
    # A list of edges.
    edges: [RefundLineItemEdge!]!

    # A list of the nodes contained in RefundLineItemEdge.
    nodes: [RefundLineItem!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one RefundLineItem and a cursor during pagination.
type RefundLineItemEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of RefundLineItemEdge.
    node: RefundLineItem!
}

# An auto-generated type for paginating through multiple OrderTransactions.
type OrderTransactionConnection {
    # A list of edges.
    edges: [OrderTransactionEdge!]!

    # A list of the nodes contained in OrderTransactionEdge.
    nodes: [OrderTransaction!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one OrderTransaction and a cursor during pagination.
type OrderTransactionEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of OrderTransactionEdge.
    node: OrderTransaction!
}

# An auto-generated type for paginating through multiple SellingPlanGroups.
type SellingPlanGroupConnection {
    # A list of edges.
    edges: [SellingPlanGroupEdge!]!

    # A list of the nodes contained in SellingPlanGroupEdge.
    nodes: [SellingPlanGroup!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one SellingPlanGroup and a cursor during pagination.
type SellingPlanGroupEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of SellingPlanGroupEdge.
    node: SellingPlanGroup!
}

# An auto-generated type for paginating through multiple LineItems.
type LineItemConnection {
    # A list of edges.
    edges: [LineItemEdge!]!

    # A list of the nodes contained in LineItemEdge.
    nodes: [LineItem!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one LineItem and a cursor during pagination.
type LineItemEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of LineItemEdge.
    node: LineItem!
}

# An auto-generated type for paginating through multiple ShippingLines.
type ShippingLineConnection {
    # A list of edges.
    edges: [ShippingLineEdge!]!

    # A list of the nodes contained in ShippingLineEdge.
    nodes: [ShippingLine!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one ShippingLine and a cursor during pagination.
type ShippingLineEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of ShippingLineEdge.
    node: ShippingLine!
}

# An auto-generated type for paginating through multiple DraftOrderLineItems.
type DraftOrderLineItemConnection {
    # A list of edges.
    edges: [DraftOrderLineItemEdge!]!

    # A list of the nodes contained in DraftOrderLineItemEdge.
    nodes: [DraftOrderLineItem!]!

    # Information to aid in pagination.
    pageInfo: PageInfo!
}

# An auto-generated type which holds one DraftOrderLineItem and a cursor during pagination.
type DraftOrderLineItemEdge {
    # A cursor for use in pagination.
    cursor: String!

    # The item at the end of DraftOrderLineItemEdge.
    node: DraftOrderLineItem!
}
