# The application that created the order.
type OrderApp {
    # The application icon.
    icon: Image!

    # The application ID.
    id: ID!

    # The name of the application.
    name: String!
}

# Requirements that must be met before an app can be installed.
type FailedRequirement {
    # Action to be taken to resolve a failed requirement, including URL link.
    action: NavigationItem

    # A concise set of copy strings to be displayed to merchants, to guide them in resolving problems your app
    # encounters when trying to make use of their Shop and its resources.
    message: String!
}

# A navigation item, holding basic link attributes.
type NavigationItem {
    # The unique identifier of the navigation item.
    id: String!

    # The name of the navigation item.
    title: String!

    # The URL of the page that the navigation item links to.
    url: URL!
}

# Reports the status of shops and their resources and displays this information
# within Shopify admin. AppFeedback is used to notify merchants about steps they need to take
# to set up an app on their store.
type AppFeedback {
    # The application associated to the feedback.
    app: App!

    # A link to where merchants can resolve errors.
    link: Link

    # The feedback message presented to the merchant.
    messages: [UserError!]!
}

# Represents an installed application on a shop.
type AppInstallation implements HasMetafields&Node {
    # The access scopes granted to the application by a merchant during installation.
    accessScopes: [AccessScope!]!

    # The active application subscriptions billed to the shop on a recurring basis.
    activeSubscriptions: [AppSubscription!]!

    # All subscriptions created for a shop.
    allSubscriptions(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
        sortKey: AppSubscriptionSortKeys = CREATED_AT
    ): AppSubscriptionConnection!

    # Application which is installed.
    app: App!

    # Credits that can be used towards future app purchases.
    credits(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
        sortKey: AppTransactionSortKeys = CREATED_AT
    ): AppCreditConnection!

    # A globally-unique identifier.
    id: ID!

    # The URL to launch the application.
    launchUrl: URL!

    # Returns a metafield by namespace and key that belongs to the resource.
    metafield(namespace: String!key: String!): Metafield

    # List of metafields that belong to the resource.
    metafields(
        namespace: String
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): MetafieldConnection!

    # One-time purchases to a shop.
    oneTimePurchases(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
        sortKey: AppTransactionSortKeys = CREATED_AT
    ): AppPurchaseOneTimeConnection!

    # Returns a private metafield by namespace and key that belongs to the resource.
    privateMetafield(namespace: String!key: String!): PrivateMetafield

    # List of private metafields that belong to the resource.
    privateMetafields(
        namespace: String
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): PrivateMetafieldConnection!

    # The publication associated with the installed application.
    publication: Publication

    # The records that track the externally-captured revenue for the app. The records are used for revenue attribution purposes.
    revenueAttributionRecords(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
        sortKey: AppRevenueAttributionRecordSortKeys = CREATED_AT
    ): AppRevenueAttributionRecordConnection!

    # The URL to uninstall the application.
    uninstallUrl: URL
}

# Provides users access to services and/or features for a duration of time.
type AppSubscription implements Node {
    # The date and time when the app subscription was created.
    createdAt: DateTime!

    # The date and time when the current app subscription period ends. Returns null if the subscription isn't active.
    currentPeriodEnd: DateTime

    # A globally-unique identifier.
    id: ID!

    # The plans attached to the app subscription.
    lineItems: [AppSubscriptionLineItem!]!

    # The name of the app subscription.
    name: String!

    # The URL that the merchant is redirected to after approving the app subscription.
    returnUrl: URL!

    # The status of the app subscription.
    status: AppSubscriptionStatus!

    # Specifies whether the app subscription is a test transaction.
    test: Boolean!

    # The number of free trial days, starting at the subscription's creation date, by which billing is delayed.
    trialDays: Int!
}

# The plan attached to an app subscription.
type AppSubscriptionLineItem {
    # A globally-unique identifier.
    id: ID!

    # The pricing model for the app subscription.
    plan: AppPlanV2!

    # A list of the store's usage records for a usage pricing plan.
    usageRecords(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
        sortKey: AppUsageRecordSortKeys = CREATED_AT
    ): AppUsageRecordConnection!
}

# The app plan that the merchant is subscribed to.
type AppPlanV2 {
    # The plan billed to a shop on a recurring basis.
    pricingDetails: AppPricingDetails!
}

# A link to direct users to.
type Link implements HasPublishedTranslations {
    # A context-sensitive label for the link.
    label: String!

    # The translations associated with the resource.
    translations(locale: String!marketId: ID): [PublishedTranslation!]!

    # The URL that the link visits.
    url: URL!
}

# A publication is a group of products and collections that is published to an app.
type Publication implements Node {
    # The app associated with the publication.
    app: App!

    # The collection publications for the list of collections published to the publication.
    collectionPublicationsV3(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): ResourcePublicationConnection!

    # The list of collections published to the publication.
    collections(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): CollectionConnection!

    # Whether the collection is available to the publication.
    hasCollection(id: ID!): Boolean!

    # A globally-unique identifier.
    id: ID!

    # Name of the publication.
    name: String!

    # The product publications for the list of products published to the publication.
    productPublicationsV3(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): ResourcePublicationConnection!

    # The list of products published to the publication.
    products(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): ProductConnection!

    # Whether the publication supports future publishing.
    supportsFuturePublishing: Boolean!
}

# App credits can be applied by the merchant towards future app purchases, subscriptions, or usage records in Shopify.
type AppCredit implements Node {
    # The amount that can be used towards future app purchases in Shopify.
    amount: MoneyV2!

    # The date and time when the app credit was created.
    createdAt: DateTime!

    # The description of the app credit.
    description: String!

    # A globally-unique identifier.
    id: ID!

    # Whether the app credit is a test transaction.
    test: Boolean!
}

# Services and features purchased once by a store.
type AppPurchaseOneTime implements AppPurchase&Node {
    # The date and time when the app purchase occurred.
    createdAt: DateTime!

    # A globally-unique identifier.
    id: ID!

    # The name of the app purchase.
    name: String!

    # The amount to be charged to the store for the app purchase.
    price: MoneyV2!

    # The status of the app purchase.
    status: AppPurchaseStatus!

    # Whether the app purchase is a test transaction.
    test: Boolean!
}

# Represents app revenue that was captured externally by the partner.
type AppRevenueAttributionRecord implements Node {
    # The financial amount captured in this attribution.
    amount: MoneyV2!

    # The timestamp when the financial amount was captured.
    capturedAt: DateTime!

    # The timestamp at which this revenue attribution was issued.
    createdAt: DateTime!

    # A globally-unique identifier.
    id: ID!

    # The unique value submitted during the creation of the app revenue attribution record.
    # For more information, refer to Idempotent requests.
    idempotencyKey: String!

    # Indicates whether this is a test submission.
    test: Boolean!

    # The type of revenue attribution.
    type: AppRevenueAttributionType!
}

# Store usage for app subscriptions with usage pricing.
type AppUsageRecord implements Node {
    # The date and time when the usage record was created.
    createdAt: DateTime!

    # The description of the app usage record.
    description: String!

    # A globally-unique identifier.
    id: ID!

    # The price of the usage record. The only permitted currency code is USD.
    price: MoneyV2!

    # Defines the usage pricing plan the merchant is subscribed to.
    subscriptionLineItem: AppSubscriptionLineItem!
}

# SEO information.
type SEO {
    # SEO Description.
    description: String

    # SEO Title.
    title: String
}

# SEO information.
input SEOInput {
    # SEO title of the product.
    title: String

    # SEO description of the product.
    description: String
}

# Represents feedback from apps about a resource, and the steps required to set up the apps on the shop.
type ResourceFeedback {
    # List of AppFeedback detailing issues regarding a resource.
    details: [AppFeedback!]!

    # Summary of resource feedback pertaining to the resource.
    summary: String!
}

# Represents a Subscription Contract.
type SubscriptionContract implements Node&SubscriptionContractBase {
    # The subscription app that the subscription contract is registered to.
    app: App

    # The URL of the subscription contract page on the subscription app.
    appAdminUrl: URL

    # The list of billing attempts associated with the subscription contract.
    billingAttempts(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): SubscriptionBillingAttemptConnection!

    # The billing policy associated with the subscription contract.
    billingPolicy: SubscriptionBillingPolicy!

    # The date and time when the subscription contract was created.
    createdAt: DateTime!

    # The currency that's used for the subscription contract.
    currencyCode: CurrencyCode!

    # A list of the custom attributes to be added to the generated orders.
    customAttributes: [Attribute!]!

    # The customer to whom the subscription contract belongs.
    customer: Customer

    # The customer payment method that's used for the subscription contract.
    customerPaymentMethod(showRevoked: Boolean = false): CustomerPaymentMethod

    # The delivery method for each billing of the subscription contract.
    deliveryMethod: SubscriptionDeliveryMethod

    # The delivery policy associated with the subscription contract.
    deliveryPolicy: SubscriptionDeliveryPolicy!

    # The delivery price for each billing of the subscription contract.
    deliveryPrice: MoneyV2!

    # The list of subscription discounts associated with the subscription contract.
    discounts(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): SubscriptionManualDiscountConnection!

    # A globally-unique identifier.
    id: ID!

    # The current status of the last payment.
    lastPaymentStatus: SubscriptionContractLastPaymentStatus

    # The number of lines associated with the subscription contract.
    lineCount: Int!

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

    # The next billing date for the subscription contract.
    nextBillingDate: DateTime

    # The note field that will be applied to the generated orders.
    note: String

    # A list of the subscription contract's orders.
    orders(
        first: Int
        after: String
        last: Int
        before: String
        reverse: Boolean = false
    ): OrderConnection!

    # The order from which this contract originated.
    originOrder: Order

    # The current status of the subscription contract.
    status: SubscriptionContractSubscriptionStatus!

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

# A setting for a presentment currency.
type CurrencySetting {
    # The currency's ISO code.
    currencyCode: CurrencyCode!

    # The full name of the currency.
    currencyName: String!

    # Whether the currency is enabled or not.
    # An enabled currency setting is visible to buyers and allows orders to be generated with that currency as presentment.
    enabled: Boolean!

    # The date and time when the active exchange rate for the currency was last modified.
    # It can be the automatic rate's creation date, or the manual rate's last updated at date if active.
    rateUpdatedAt: DateTime
}

# A unique string that represents the address of a Shopify store on the Internet.
type Domain implements Node {
    # The host name of the domain. For example, example.com.
    host: String!

    # A globally-unique identifier.
    id: ID!

    # The localization of the domain, if the domain doesn't redirect.
    localization: DomainLocalization

    # The web presence of the domain.
    marketWebPresence: MarketWebPresence

    # Whether SSL is enabled.
    sslEnabled: Boolean!

    # The URL of the domain (for example, https://example.com).
    url: URL!
}

# The country and language settings assigned to a domain.
type DomainLocalization {
    # The ISO codes for the domain’s alternate locales. For example, ["en"].
    alternateLocales: [String!]!

    # The ISO code for the country assigned to the domain. For example, "CA" or "*" for a domain set to "Rest of world".
    country: String

    # The ISO code for the domain’s default locale. For example, "en".
    defaultLocale: String!
}

# A custom page on the Online Store.
type OnlineStorePage implements HasPublishedTranslations&Navigable&Node {
    # A default cursor that returns the single next record, sorted ascending by ID.
    defaultCursor: String!

    # A globally-unique identifier.
    id: ID!

    # The translations associated with the resource.
    translations(locale: String!marketId: ID): [PublishedTranslation!]!
}

# Automatic discount applications capture the intentions of a discount that was automatically applied.
type AutomaticDiscountApplication implements DiscountApplication {
    # The method by which the discount's value is applied to its entitled items.
    allocationMethod: DiscountApplicationAllocationMethod!

    # An ordered index that can be used to identify the discount application and indicate the precedence
    # of the discount application for calculations.
    index: Int!

    # How the discount amount is distributed on the discounted lines.
    targetSelection: DiscountApplicationTargetSelection!

    # Whether the discount is applied on line items or shipping lines.
    targetType: DiscountApplicationTargetType!

    # The title of the discount application.
    title: String!

    # The value of the discount application.
    value: PricingValue!
}

# Discount code applications capture the intentions of a discount code at
# he time that it is applied onto an order.
#
# Discount applications don't represent the actual final amount discounted on a line (line item or shipping line). The actual amount discounted on a line is represented by the DiscountAllocation object.
type DiscountCodeApplication implements DiscountApplication {
    # The method by which the discount's value is applied to its entitled items.
    allocationMethod: DiscountApplicationAllocationMethod!

    # The string identifying the discount code that was used at the time of application.
    code: String!

    # An ordered index that can be used to identify the discount application and indicate the precedence
    # of the discount application for calculations.
    index: Int!

    # How the discount amount is distributed on the discounted lines.
    targetSelection: DiscountApplicationTargetSelection!

    # Whether the discount is applied on line items or shipping lines.
    targetType: DiscountApplicationTargetType!

    # The value of the discount application.
    value: PricingValue!
}

# Manual discount applications capture the intentions of a discount that was manually created for an order.
#
# Discount applications don't represent the actual final amount discounted on a line (line item or shipping line).
# The actual amount discounted on a line is represented by the DiscountAllocation object.
type ManualDiscountApplication implements DiscountApplication {
    # The method by which the discount's value is applied to its entitled items.
    allocationMethod: DiscountApplicationAllocationMethod!

    # The description of the discount application.
    description: String

    # An ordered index that can be used to identify the discount application and indicate the precedence
    # of the discount application for calculations.
    index: Int!

    # How the discount amount is distributed on the discounted lines.
    targetSelection: DiscountApplicationTargetSelection!

    # Whether the discount is applied on line items or shipping lines.
    targetType: DiscountApplicationTargetType!

    # The title of the discount application.
    title: String!

    # The value of the discount application.
    value: PricingValue!
}

# Script discount applications capture the intentions of a discount that
# was created by a Shopify Script for an order's line item or shipping line.
#
# Discount applications don't represent the actual final amount discounted on a line (line item or shipping line).
# The actual amount discounted on a line is represented by the DiscountAllocation object.
type ScriptDiscountApplication implements DiscountApplication {
    # The method by which the discount's value is applied to its entitled items.
    allocationMethod: DiscountApplicationAllocationMethod!

    # An ordered index that can be used to identify the discount application and indicate the precedence
    # of the discount application for calculations.
    index: Int!

    # How the discount amount is distributed on the discounted lines.
    targetSelection: DiscountApplicationTargetSelection!

    # Whether the discount is applied on line items or shipping lines.
    targetType: DiscountApplicationTargetType!

    # The title of the application as defined by the Script.
    title: String!

    # The value of the discount application.
    value: PricingValue!
}

# An auto-generated type for paginating through multiple Sales.
type SaleConnection {
    # A list of edges.
    edges: [SaleEdge!]!

    # A list of the nodes contained in SaleEdge.
    nodes: [Sale!]!

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

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

    # The item at the end of SaleEdge.
    node: Sale!
}

# An auto-generated type for paginating through multiple AppSubscriptions.
type AppSubscriptionConnection {
    # A list of edges.
    edges: [AppSubscriptionEdge!]!

    # A list of the nodes contained in AppSubscriptionEdge.
    nodes: [AppSubscription!]!

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

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

    # The item at the end of AppSubscriptionEdge.
    node: AppSubscription!
}

# An auto-generated type for paginating through multiple AppCredits.
type AppCreditConnection {
    # A list of edges.
    edges: [AppCreditEdge!]!

    # A list of the nodes contained in AppCreditEdge.
    nodes: [AppCredit!]!

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

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

    # The item at the end of AppCreditEdge.
    node: AppCredit!
}

# An auto-generated type for paginating through multiple Apps.
type AppConnection {
    # A list of edges.
    edges: [AppEdge!]!

    # A list of the nodes contained in AppEdge.
    nodes: [App!]!

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

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

    # The item at the end of AppEdge.
    node: App!
}

# An auto-generated type for paginating through multiple CurrencySettings.
type CurrencySettingConnection {
    # A list of edges.
    edges: [CurrencySettingEdge!]!

    # A list of the nodes contained in CurrencySettingEdge.
    nodes: [CurrencySetting!]!

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

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

    # The item at the end of CurrencySettingEdge.
    node: CurrencySetting!
}

# An auto-generated type for paginating through multiple SalesAgreements.
type SalesAgreementConnection {
    # A list of edges.
    edges: [SalesAgreementEdge!]!

    # A list of the nodes contained in SalesAgreementEdge.
    nodes: [SalesAgreement!]!

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

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

    # The item at the end of SalesAgreementEdge.
    node: SalesAgreement!
}

# An auto-generated type for paginating through multiple DiscountApplications.
type DiscountApplicationConnection {
    # A list of edges.
    edges: [DiscountApplicationEdge!]!

    # A list of the nodes contained in DiscountApplicationEdge.
    nodes: [DiscountApplication!]!

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

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

    # The item at the end of DiscountApplicationEdge.
    node: DiscountApplication!
}
