type Query {
  """
  The active Channel
  """
  activeChannel: Channel!

  """
  The active Customer
  """
  activeCustomer: Customer

  """
  The active Order. Will be `null` until an Order is created via `addItemToOrder`. Once an Order reaches the
  state of `PaymentApproved` or `PaymentSettled`, then that Order is no longer considered "active" and this
  query will once again return `null`.
  """
  activeOrder: Order

  """
  An array of supported Countries
  """
  availableCountries: [Country!]!

  """
  A list of Collections available to the shop
  """
  collections(options: CollectionListOptions): CollectionList!

  """
  Returns a Collection either by its id or slug. If neither 'id' nor 'slug' is speicified, an error will result.
  """
  collection(id: ID, slug: String): Collection

  """
  Returns a list of eligible shipping methods based on the current active Order
  """
  eligibleShippingMethods: [ShippingMethodQuote!]!

  """
  Returns a list of payment methods and their eligibility based on the current active Order
  """
  eligiblePaymentMethods: [PaymentMethodQuote!]!

  """
  Returns information about the current authenticated User
  """
  me: CurrentUser

  """
  Returns the possible next states that the activeOrder can transition to
  """
  nextOrderStates: [String!]!

  """
  Returns an Order based on the id. Note that in the Shop API, only orders belonging to the
  currently-authenticated User may be queried.
  """
  order(id: ID!): Order

  """
  Returns an Order based on the order `code`. For guest Orders (i.e. Orders placed by non-authenticated Customers)
  this query will only return the Order within 2 hours of the Order being placed. This allows an Order confirmation
  screen to be shown immediately after completion of a guest checkout, yet prevents security risks of allowing
  general anonymous access to Order data.
  """
  orderByCode(code: String!): Order

  """
  Get a Product either by id or slug. If neither 'id' nor 'slug' is speicified, an error will result.
  """
  product(id: ID, slug: String): Product

  """
  Get a list of Products
  """
  products(options: ProductListOptions): ProductList!

  """
  Search Products based on the criteria set by the `SearchInput`
  """
  search(input: SearchInput!): SearchResponse!
}

type Mutation {
  """
  Adds an item to the order. If custom fields are defined on the OrderLine entity, a third argument 'customFields' will be available.
  """
  addItemToOrder(productVariantId: ID!, quantity: Int!): UpdateOrderItemsResult!

  """
  Remove an OrderLine from the Order
  """
  removeOrderLine(orderLineId: ID!): RemoveOrderItemsResult!

  """
  Remove all OrderLine from the Order
  """
  removeAllOrderLines: RemoveOrderItemsResult!

  """
  Adjusts an OrderLine. If custom fields are defined on the OrderLine entity, a third argument 'customFields' of type `OrderLineCustomFieldsInput` will be available.
  """
  adjustOrderLine(orderLineId: ID!, quantity: Int!): UpdateOrderItemsResult!

  """
  Applies the given coupon code to the active Order
  """
  applyCouponCode(couponCode: String!): ApplyCouponCodeResult!

  """
  Removes the given coupon code from the active Order
  """
  removeCouponCode(couponCode: String!): Order

  """
  Transitions an Order to a new state. Valid next states can be found by querying `nextOrderStates`
  """
  transitionOrderToState(state: String!): TransitionOrderToStateResult

  """
  Sets the shipping address for this order
  """
  setOrderShippingAddress(input: CreateAddressInput!): ActiveOrderResult!

  """
  Sets the billing address for this order
  """
  setOrderBillingAddress(input: CreateAddressInput!): ActiveOrderResult!

  """
  Allows any custom fields to be set for the active order
  """
  setOrderCustomFields(input: UpdateOrderInput!): ActiveOrderResult!

  """
  Sets the shipping method by id, which can be obtained with the `eligibleShippingMethods` query
  """
  setOrderShippingMethod(shippingMethodId: ID!): SetOrderShippingMethodResult!

  """
  Add a Payment to the Order
  """
  addPaymentToOrder(input: PaymentInput!): AddPaymentToOrderResult!

  """
  Set the Customer for the Order. Required only if the Customer is not currently logged in
  """
  setCustomerForOrder(input: CreateCustomerInput!): SetCustomerForOrderResult!

  """
  Authenticates the user using the native authentication strategy. This mutation is an alias for `authenticate({ native: { ... }})`
  """
  login(
    username: String!
    password: String!
    rememberMe: Boolean
  ): NativeAuthenticationResult!

  """
  Authenticates the user using a named authentication strategy
  """
  authenticate(
    input: AuthenticationInput!
    rememberMe: Boolean
  ): AuthenticationResult!

  """
  End the current authenticated session
  """
  logout: Success!

  """
  Register a Customer account with the given credentials. There are three possible registration flows:

  _If `authOptions.requireVerification` is set to `true`:_

  1. **The Customer is registered _with_ a password**. A verificationToken will be created (and typically emailed to the Customer). That
     verificationToken would then be passed to the `verifyCustomerAccount` mutation _without_ a password. The Customer is then
     verified and authenticated in one step.
  2. **The Customer is registered _without_ a password**. A verificationToken will be created (and typically emailed to the Customer). That
     verificationToken would then be passed to the `verifyCustomerAccount` mutation _with_ the chosed password of the Customer. The Customer is then
     verified and authenticated in one step.

  _If `authOptions.requireVerification` is set to `false`:_

  3. The Customer _must_ be registered _with_ a password. No further action is needed - the Customer is able to authenticate immediately.
  """
  registerCustomerAccount(
    input: RegisterCustomerInput!
  ): RegisterCustomerAccountResult!

  """
  Regenerate and send a verification token for a new Customer registration. Only applicable if `authOptions.requireVerification` is set to true.
  """
  refreshCustomerVerification(
    emailAddress: String!
  ): RefreshCustomerVerificationResult!

  """
  Update an existing Customer
  """
  updateCustomer(input: UpdateCustomerInput!): Customer!

  """
  Create a new Customer Address
  """
  createCustomerAddress(input: CreateAddressInput!): Address!

  """
  Update an existing Address
  """
  updateCustomerAddress(input: UpdateAddressInput!): Address!

  """
  Delete an existing Address
  """
  deleteCustomerAddress(id: ID!): Success!

  """
  Verify a Customer email address with the token sent to that address. Only applicable if `authOptions.requireVerification` is set to true.

  If the Customer was not registered with a password in the `registerCustomerAccount` mutation, the a password _must_ be
  provided here.
  """
  verifyCustomerAccount(
    token: String!
    password: String
  ): VerifyCustomerAccountResult!

  """
  Update the password of the active Customer
  """
  updateCustomerPassword(
    currentPassword: String!
    newPassword: String!
  ): UpdateCustomerPasswordResult!

  """
  Request to update the emailAddress of the active Customer. If `authOptions.requireVerification` is enabled
  (as is the default), then the `identifierChangeToken` will be assigned to the current User and
  a IdentifierChangeRequestEvent will be raised. This can then be used e.g. by the EmailPlugin to email
  that verification token to the Customer, which is then used to verify the change of email address.
  """
  requestUpdateCustomerEmailAddress(
    password: String!
    newEmailAddress: String!
  ): RequestUpdateCustomerEmailAddressResult!

  """
  Confirm the update of the emailAddress with the provided token, which has been generated by the
  `requestUpdateCustomerEmailAddress` mutation.
  """
  updateCustomerEmailAddress(token: String!): UpdateCustomerEmailAddressResult!

  """
  Requests a password reset email to be sent
  """
  requestPasswordReset(emailAddress: String!): RequestPasswordResetResult

  """
  Resets a Customer's password based on the provided token
  """
  resetPassword(token: String!, password: String!): ResetPasswordResult!
}

type Address implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  fullName: String
  company: String
  streetLine1: String!
  streetLine2: String
  city: String
  province: String
  postalCode: String
  country: Country!
  phoneNumber: String
  defaultShippingAddress: Boolean
  defaultBillingAddress: Boolean
  customFields: JSON
}

type Asset implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  name: String!
  type: AssetType!
  fileSize: Int!
  mimeType: String!
  width: Int!
  height: Int!
  source: String!
  preview: String!
  focalPoint: Coordinate
  customFields: JSON
}

type Coordinate {
  x: Float!
  y: Float!
}

type AssetList implements PaginatedList {
  items: [Asset!]!
  totalItems: Int!
}

enum AssetType {
  IMAGE
  VIDEO
  BINARY
}

type CurrentUser {
  id: ID!
  identifier: String!
  channels: [CurrentUserChannel!]!
}

type CurrentUserChannel {
  id: ID!
  token: String!
  code: String!
  permissions: [Permission!]!
}

type Channel implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  code: String!
  token: String!
  defaultTaxZone: Zone
  defaultShippingZone: Zone
  defaultLanguageCode: LanguageCode!
  currencyCode: CurrencyCode!
  pricesIncludeTax: Boolean!
  customFields: JSON
}

type Collection implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode
  name: String!
  slug: String!
  breadcrumbs: [CollectionBreadcrumb!]!
  position: Int!
  description: String!
  featuredAsset: Asset
  assets: [Asset!]!
  parent: Collection
  children: [Collection!]
  filters: [ConfigurableOperation!]!
  translations: [CollectionTranslation!]!
  productVariants(options: ProductVariantListOptions): ProductVariantList!
  customFields: JSON
}

type CollectionBreadcrumb {
  id: ID!
  name: String!
  slug: String!
}

type CollectionTranslation {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
  slug: String!
  description: String!
}

type CollectionList implements PaginatedList {
  items: [Collection!]!
  totalItems: Int!
}

type ProductVariantList implements PaginatedList {
  items: [ProductVariant!]!
  totalItems: Int!
}

input ProductVariantListOptions {
  skip: Int
  take: Int
  sort: ProductVariantSortParameter
  filter: ProductVariantFilterParameter
}

enum GlobalFlag {
  TRUE
  FALSE
  INHERIT
}

enum AdjustmentType {
  PROMOTION
  DISTRIBUTED_ORDER_PROMOTION
}

enum DeletionResult {
  """
  The entity was successfully deleted
  """
  DELETED

  """
  Deletion did not take place, reason given in message
  """
  NOT_DELETED
}

"""
@description
Permissions for administrators and customers. Used to control access to
GraphQL resolvers via the {@link Allow} decorator.

@docsCategory common
"""
enum Permission {
  Placeholder

  """
  Authenticated means simply that the user is logged in
  """
  Authenticated

  """
  SuperAdmin has unrestricted access to all operations
  """
  SuperAdmin

  """
  Owner means the user owns this entity, e.g. a Customer's own Order
  """
  Owner

  """
  Public means any unauthenticated user may perform the operation
  """
  Public

  """
  Grants permission to update GlobalSettings
  """
  UpdateGlobalSettings

  """
  Grants permission to create Products, Facets, Assets, Collections
  """
  CreateCatalog

  """
  Grants permission to read Products, Facets, Assets, Collections
  """
  ReadCatalog

  """
  Grants permission to update Products, Facets, Assets, Collections
  """
  UpdateCatalog

  """
  Grants permission to delete Products, Facets, Assets, Collections
  """
  DeleteCatalog

  """
  Grants permission to create PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings
  """
  CreateSettings

  """
  Grants permission to read PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings
  """
  ReadSettings

  """
  Grants permission to update PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings
  """
  UpdateSettings

  """
  Grants permission to delete PaymentMethods, ShippingMethods, TaxCategories, TaxRates, Zones, Countries, System & GlobalSettings
  """
  DeleteSettings

  """
  Grants permission to create Administrator
  """
  CreateAdministrator

  """
  Grants permission to read Administrator
  """
  ReadAdministrator

  """
  Grants permission to update Administrator
  """
  UpdateAdministrator

  """
  Grants permission to delete Administrator
  """
  DeleteAdministrator

  """
  Grants permission to create Asset
  """
  CreateAsset

  """
  Grants permission to read Asset
  """
  ReadAsset

  """
  Grants permission to update Asset
  """
  UpdateAsset

  """
  Grants permission to delete Asset
  """
  DeleteAsset

  """
  Grants permission to create Channel
  """
  CreateChannel

  """
  Grants permission to read Channel
  """
  ReadChannel

  """
  Grants permission to update Channel
  """
  UpdateChannel

  """
  Grants permission to delete Channel
  """
  DeleteChannel

  """
  Grants permission to create Collection
  """
  CreateCollection

  """
  Grants permission to read Collection
  """
  ReadCollection

  """
  Grants permission to update Collection
  """
  UpdateCollection

  """
  Grants permission to delete Collection
  """
  DeleteCollection

  """
  Grants permission to create Country
  """
  CreateCountry

  """
  Grants permission to read Country
  """
  ReadCountry

  """
  Grants permission to update Country
  """
  UpdateCountry

  """
  Grants permission to delete Country
  """
  DeleteCountry

  """
  Grants permission to create Customer
  """
  CreateCustomer

  """
  Grants permission to read Customer
  """
  ReadCustomer

  """
  Grants permission to update Customer
  """
  UpdateCustomer

  """
  Grants permission to delete Customer
  """
  DeleteCustomer

  """
  Grants permission to create CustomerGroup
  """
  CreateCustomerGroup

  """
  Grants permission to read CustomerGroup
  """
  ReadCustomerGroup

  """
  Grants permission to update CustomerGroup
  """
  UpdateCustomerGroup

  """
  Grants permission to delete CustomerGroup
  """
  DeleteCustomerGroup

  """
  Grants permission to create Facet
  """
  CreateFacet

  """
  Grants permission to read Facet
  """
  ReadFacet

  """
  Grants permission to update Facet
  """
  UpdateFacet

  """
  Grants permission to delete Facet
  """
  DeleteFacet

  """
  Grants permission to create Order
  """
  CreateOrder

  """
  Grants permission to read Order
  """
  ReadOrder

  """
  Grants permission to update Order
  """
  UpdateOrder

  """
  Grants permission to delete Order
  """
  DeleteOrder

  """
  Grants permission to create PaymentMethod
  """
  CreatePaymentMethod

  """
  Grants permission to read PaymentMethod
  """
  ReadPaymentMethod

  """
  Grants permission to update PaymentMethod
  """
  UpdatePaymentMethod

  """
  Grants permission to delete PaymentMethod
  """
  DeletePaymentMethod

  """
  Grants permission to create Product
  """
  CreateProduct

  """
  Grants permission to read Product
  """
  ReadProduct

  """
  Grants permission to update Product
  """
  UpdateProduct

  """
  Grants permission to delete Product
  """
  DeleteProduct

  """
  Grants permission to create Promotion
  """
  CreatePromotion

  """
  Grants permission to read Promotion
  """
  ReadPromotion

  """
  Grants permission to update Promotion
  """
  UpdatePromotion

  """
  Grants permission to delete Promotion
  """
  DeletePromotion

  """
  Grants permission to create ShippingMethod
  """
  CreateShippingMethod

  """
  Grants permission to read ShippingMethod
  """
  ReadShippingMethod

  """
  Grants permission to update ShippingMethod
  """
  UpdateShippingMethod

  """
  Grants permission to delete ShippingMethod
  """
  DeleteShippingMethod

  """
  Grants permission to create Tag
  """
  CreateTag

  """
  Grants permission to read Tag
  """
  ReadTag

  """
  Grants permission to update Tag
  """
  UpdateTag

  """
  Grants permission to delete Tag
  """
  DeleteTag

  """
  Grants permission to create TaxCategory
  """
  CreateTaxCategory

  """
  Grants permission to read TaxCategory
  """
  ReadTaxCategory

  """
  Grants permission to update TaxCategory
  """
  UpdateTaxCategory

  """
  Grants permission to delete TaxCategory
  """
  DeleteTaxCategory

  """
  Grants permission to create TaxRate
  """
  CreateTaxRate

  """
  Grants permission to read TaxRate
  """
  ReadTaxRate

  """
  Grants permission to update TaxRate
  """
  UpdateTaxRate

  """
  Grants permission to delete TaxRate
  """
  DeleteTaxRate

  """
  Grants permission to create System
  """
  CreateSystem

  """
  Grants permission to read System
  """
  ReadSystem

  """
  Grants permission to update System
  """
  UpdateSystem

  """
  Grants permission to delete System
  """
  DeleteSystem

  """
  Grants permission to create Zone
  """
  CreateZone

  """
  Grants permission to read Zone
  """
  ReadZone

  """
  Grants permission to update Zone
  """
  UpdateZone

  """
  Grants permission to delete Zone
  """
  DeleteZone
}

enum SortOrder {
  ASC
  DESC
}

enum ErrorCode {
  UNKNOWN_ERROR
  NATIVE_AUTH_STRATEGY_ERROR
  INVALID_CREDENTIALS_ERROR
  ORDER_STATE_TRANSITION_ERROR
  EMAIL_ADDRESS_CONFLICT_ERROR
  ORDER_LIMIT_ERROR
  NEGATIVE_QUANTITY_ERROR
  INSUFFICIENT_STOCK_ERROR
  ORDER_MODIFICATION_ERROR
  INELIGIBLE_SHIPPING_METHOD_ERROR
  ORDER_PAYMENT_STATE_ERROR
  INELIGIBLE_PAYMENT_METHOD_ERROR
  PAYMENT_FAILED_ERROR
  PAYMENT_DECLINED_ERROR
  COUPON_CODE_INVALID_ERROR
  COUPON_CODE_EXPIRED_ERROR
  COUPON_CODE_LIMIT_ERROR
  ALREADY_LOGGED_IN_ERROR
  MISSING_PASSWORD_ERROR
  PASSWORD_ALREADY_SET_ERROR
  VERIFICATION_TOKEN_INVALID_ERROR
  VERIFICATION_TOKEN_EXPIRED_ERROR
  IDENTIFIER_CHANGE_TOKEN_INVALID_ERROR
  IDENTIFIER_CHANGE_TOKEN_EXPIRED_ERROR
  PASSWORD_RESET_TOKEN_INVALID_ERROR
  PASSWORD_RESET_TOKEN_EXPIRED_ERROR
  NOT_VERIFIED_ERROR
  NO_ACTIVE_ORDER_ERROR
}

enum LogicalOperator {
  AND
  OR
}

"""
Retured when attempting an operation that relies on the NativeAuthStrategy, if that strategy is not configured.
"""
type NativeAuthStrategyError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Returned if the user authentication credentials are not valid
"""
type InvalidCredentialsError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  authenticationError: String!
}

"""
Returned if there is an error in transitioning the Order state
"""
type OrderStateTransitionError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  transitionError: String!
  fromState: String!
  toState: String!
}

"""
Retured when attemting to create a Customer with an email address already registered to an existing User.
"""
type EmailAddressConflictError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Retured when the maximum order size limit has been reached.
"""
type OrderLimitError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  maxItems: Int!
}

"""
Retured when attemting to set a negative OrderLine quantity.
"""
type NegativeQuantityError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Returned when attempting to add more items to the Order than are available
"""
type InsufficientStockError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  quantityAvailable: Int!
  order: Order!
}

"""
The `JSON` scalar type represents JSON values as specified by [ECMA-404](http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf).
"""
scalar JSON

"""
A date-time string at UTC, such as 2007-12-03T10:15:30Z, compliant with the `date-time` format outlined in section 5.6 of the RFC 3339 profile of the ISO 8601 standard for representation of dates and times using the Gregorian calendar.
"""
scalar DateTime

"""
The `Upload` scalar type represents a file upload.
"""
scalar Upload

interface PaginatedList {
  items: [Node!]!
  totalItems: Int!
}

interface Node {
  id: ID!
}

interface ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

type Adjustment {
  adjustmentSource: String!
  type: AdjustmentType!
  description: String!
  amount: Int!
}

type TaxLine {
  description: String!
  taxRate: Float!
}

type ConfigArg {
  name: String!
  value: String!
}

type ConfigArgDefinition {
  name: String!
  type: String!
  list: Boolean!
  required: Boolean!
  defaultValue: JSON
  label: String
  description: String
  ui: JSON
}

type ConfigurableOperation {
  code: String!
  args: [ConfigArg!]!
}

type ConfigurableOperationDefinition {
  code: String!
  args: [ConfigArgDefinition!]!
  description: String!
}

type DeletionResponse {
  result: DeletionResult!
  message: String
}

input ConfigArgInput {
  name: String!

  """
  A JSON stringified representation of the actual value
  """
  value: String!
}

input ConfigurableOperationInput {
  code: String!
  arguments: [ConfigArgInput!]!
}

input StringOperators {
  eq: String
  notEq: String
  contains: String
  notContains: String
  in: [String!]
  notIn: [String!]
  regex: String
}

input BooleanOperators {
  eq: Boolean
}

input NumberRange {
  start: Float!
  end: Float!
}

input NumberOperators {
  eq: Float
  lt: Float
  lte: Float
  gt: Float
  gte: Float
  between: NumberRange
}

input DateRange {
  start: DateTime!
  end: DateTime!
}

input DateOperators {
  eq: DateTime
  before: DateTime
  after: DateTime
  between: DateRange
}

"""
Used to construct boolean expressions for filtering search results
by FacetValue ID. Examples:

* ID=1 OR ID=2: `{ facetValueFilters: [{ or: [1,2] }] }`
* ID=1 AND ID=2: `{ facetValueFilters: [{ and: 1 }, { and: 2 }] }`
* ID=1 AND (ID=2 OR ID=3): `{ facetValueFilters: [{ and: 1 }, { or: [2,3] }] }`
"""
input FacetValueFilterInput {
  and: ID
  or: [ID!]
}

input SearchInput {
  term: String
  facetValueIds: [ID!]
  facetValueOperator: LogicalOperator
  facetValueFilters: [FacetValueFilterInput!]
  collectionId: ID
  collectionSlug: String
  groupByProduct: Boolean
  take: Int
  skip: Int
  sort: SearchResultSortParameter
}

input SearchResultSortParameter {
  name: SortOrder
  price: SortOrder
}

input CreateCustomerInput {
  title: String
  firstName: String!
  lastName: String!
  phoneNumber: String
  emailAddress: String!
  customFields: JSON
}

input CreateAddressInput {
  fullName: String
  company: String
  streetLine1: String!
  streetLine2: String
  city: String
  province: String
  postalCode: String
  countryCode: String!
  phoneNumber: String
  defaultShippingAddress: Boolean
  defaultBillingAddress: Boolean
  customFields: JSON
}

input UpdateAddressInput {
  id: ID!
  fullName: String
  company: String
  streetLine1: String
  streetLine2: String
  city: String
  province: String
  postalCode: String
  countryCode: String
  phoneNumber: String
  defaultShippingAddress: Boolean
  defaultBillingAddress: Boolean
  customFields: JSON
}

"""
Indicates that an operation succeeded, where we do not want to return any more specific information.
"""
type Success {
  success: Boolean!
}

type ShippingMethodQuote {
  id: ID!
  price: Int!
  priceWithTax: Int!
  code: String!
  name: String!
  description: String!

  """
  Any optional metadata returned by the ShippingCalculator in the ShippingCalculationResult
  """
  metadata: JSON
}

type PaymentMethodQuote {
  id: ID!
  code: String!
  name: String!
  description: String!
  isEligible: Boolean!
  eligibilityMessage: String
}

type Country implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  code: String!
  name: String!
  enabled: Boolean!
  translations: [CountryTranslation!]!
}

type CountryTranslation {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
}

type CountryList implements PaginatedList {
  items: [Country!]!
  totalItems: Int!
}

"""
@description
ISO 4217 currency code

@docsCategory common
"""
enum CurrencyCode {
  """
  United Arab Emirates dirham
  """
  AED

  """
  Afghan afghani
  """
  AFN

  """
  Albanian lek
  """
  ALL

  """
  Armenian dram
  """
  AMD

  """
  Netherlands Antillean guilder
  """
  ANG

  """
  Angolan kwanza
  """
  AOA

  """
  Argentine peso
  """
  ARS

  """
  Australian dollar
  """
  AUD

  """
  Aruban florin
  """
  AWG

  """
  Azerbaijani manat
  """
  AZN

  """
  Bosnia and Herzegovina convertible mark
  """
  BAM

  """
  Barbados dollar
  """
  BBD

  """
  Bangladeshi taka
  """
  BDT

  """
  Bulgarian lev
  """
  BGN

  """
  Bahraini dinar
  """
  BHD

  """
  Burundian franc
  """
  BIF

  """
  Bermudian dollar
  """
  BMD

  """
  Brunei dollar
  """
  BND

  """
  Boliviano
  """
  BOB

  """
  Brazilian real
  """
  BRL

  """
  Bahamian dollar
  """
  BSD

  """
  Bhutanese ngultrum
  """
  BTN

  """
  Botswana pula
  """
  BWP

  """
  Belarusian ruble
  """
  BYN

  """
  Belize dollar
  """
  BZD

  """
  Canadian dollar
  """
  CAD

  """
  Congolese franc
  """
  CDF

  """
  Swiss franc
  """
  CHF

  """
  Chilean peso
  """
  CLP

  """
  Renminbi (Chinese) yuan
  """
  CNY

  """
  Colombian peso
  """
  COP

  """
  Costa Rican colon
  """
  CRC

  """
  Cuban convertible peso
  """
  CUC

  """
  Cuban peso
  """
  CUP

  """
  Cape Verde escudo
  """
  CVE

  """
  Czech koruna
  """
  CZK

  """
  Djiboutian franc
  """
  DJF

  """
  Danish krone
  """
  DKK

  """
  Dominican peso
  """
  DOP

  """
  Algerian dinar
  """
  DZD

  """
  Egyptian pound
  """
  EGP

  """
  Eritrean nakfa
  """
  ERN

  """
  Ethiopian birr
  """
  ETB

  """
  Euro
  """
  EUR

  """
  Fiji dollar
  """
  FJD

  """
  Falkland Islands pound
  """
  FKP

  """
  Pound sterling
  """
  GBP

  """
  Georgian lari
  """
  GEL

  """
  Ghanaian cedi
  """
  GHS

  """
  Gibraltar pound
  """
  GIP

  """
  Gambian dalasi
  """
  GMD

  """
  Guinean franc
  """
  GNF

  """
  Guatemalan quetzal
  """
  GTQ

  """
  Guyanese dollar
  """
  GYD

  """
  Hong Kong dollar
  """
  HKD

  """
  Honduran lempira
  """
  HNL

  """
  Croatian kuna
  """
  HRK

  """
  Haitian gourde
  """
  HTG

  """
  Hungarian forint
  """
  HUF

  """
  Indonesian rupiah
  """
  IDR

  """
  Israeli new shekel
  """
  ILS

  """
  Indian rupee
  """
  INR

  """
  Iraqi dinar
  """
  IQD

  """
  Iranian rial
  """
  IRR

  """
  Icelandic króna
  """
  ISK

  """
  Jamaican dollar
  """
  JMD

  """
  Jordanian dinar
  """
  JOD

  """
  Japanese yen
  """
  JPY

  """
  Kenyan shilling
  """
  KES

  """
  Kyrgyzstani som
  """
  KGS

  """
  Cambodian riel
  """
  KHR

  """
  Comoro franc
  """
  KMF

  """
  North Korean won
  """
  KPW

  """
  South Korean won
  """
  KRW

  """
  Kuwaiti dinar
  """
  KWD

  """
  Cayman Islands dollar
  """
  KYD

  """
  Kazakhstani tenge
  """
  KZT

  """
  Lao kip
  """
  LAK

  """
  Lebanese pound
  """
  LBP

  """
  Sri Lankan rupee
  """
  LKR

  """
  Liberian dollar
  """
  LRD

  """
  Lesotho loti
  """
  LSL

  """
  Libyan dinar
  """
  LYD

  """
  Moroccan dirham
  """
  MAD

  """
  Moldovan leu
  """
  MDL

  """
  Malagasy ariary
  """
  MGA

  """
  Macedonian denar
  """
  MKD

  """
  Myanmar kyat
  """
  MMK

  """
  Mongolian tögrög
  """
  MNT

  """
  Macanese pataca
  """
  MOP

  """
  Mauritanian ouguiya
  """
  MRU

  """
  Mauritian rupee
  """
  MUR

  """
  Maldivian rufiyaa
  """
  MVR

  """
  Malawian kwacha
  """
  MWK

  """
  Mexican peso
  """
  MXN

  """
  Malaysian ringgit
  """
  MYR

  """
  Mozambican metical
  """
  MZN

  """
  Namibian dollar
  """
  NAD

  """
  Nigerian naira
  """
  NGN

  """
  Nicaraguan córdoba
  """
  NIO

  """
  Norwegian krone
  """
  NOK

  """
  Nepalese rupee
  """
  NPR

  """
  New Zealand dollar
  """
  NZD

  """
  Omani rial
  """
  OMR

  """
  Panamanian balboa
  """
  PAB

  """
  Peruvian sol
  """
  PEN

  """
  Papua New Guinean kina
  """
  PGK

  """
  Philippine peso
  """
  PHP

  """
  Pakistani rupee
  """
  PKR

  """
  Polish złoty
  """
  PLN

  """
  Paraguayan guaraní
  """
  PYG

  """
  Qatari riyal
  """
  QAR

  """
  Romanian leu
  """
  RON

  """
  Serbian dinar
  """
  RSD

  """
  Russian ruble
  """
  RUB

  """
  Rwandan franc
  """
  RWF

  """
  Saudi riyal
  """
  SAR

  """
  Solomon Islands dollar
  """
  SBD

  """
  Seychelles rupee
  """
  SCR

  """
  Sudanese pound
  """
  SDG

  """
  Swedish krona/kronor
  """
  SEK

  """
  Singapore dollar
  """
  SGD

  """
  Saint Helena pound
  """
  SHP

  """
  Sierra Leonean leone
  """
  SLL

  """
  Somali shilling
  """
  SOS

  """
  Surinamese dollar
  """
  SRD

  """
  South Sudanese pound
  """
  SSP

  """
  São Tomé and Príncipe dobra
  """
  STN

  """
  Salvadoran colón
  """
  SVC

  """
  Syrian pound
  """
  SYP

  """
  Swazi lilangeni
  """
  SZL

  """
  Thai baht
  """
  THB

  """
  Tajikistani somoni
  """
  TJS

  """
  Turkmenistan manat
  """
  TMT

  """
  Tunisian dinar
  """
  TND

  """
  Tongan paʻanga
  """
  TOP

  """
  Turkish lira
  """
  TRY

  """
  Trinidad and Tobago dollar
  """
  TTD

  """
  New Taiwan dollar
  """
  TWD

  """
  Tanzanian shilling
  """
  TZS

  """
  Ukrainian hryvnia
  """
  UAH

  """
  Ugandan shilling
  """
  UGX

  """
  United States dollar
  """
  USD

  """
  Uruguayan peso
  """
  UYU

  """
  Uzbekistan som
  """
  UZS

  """
  Venezuelan bolívar soberano
  """
  VES

  """
  Vietnamese đồng
  """
  VND

  """
  Vanuatu vatu
  """
  VUV

  """
  Samoan tala
  """
  WST

  """
  CFA franc BEAC
  """
  XAF

  """
  East Caribbean dollar
  """
  XCD

  """
  CFA franc BCEAO
  """
  XOF

  """
  CFP franc (franc Pacifique)
  """
  XPF

  """
  Yemeni rial
  """
  YER

  """
  South African rand
  """
  ZAR

  """
  Zambian kwacha
  """
  ZMW

  """
  Zimbabwean dollar
  """
  ZWL
}

interface CustomField {
  name: String!
  type: String!
  list: Boolean!
  label: [LocalizedString!]
  description: [LocalizedString!]
  readonly: Boolean
  internal: Boolean
}

type StringCustomFieldConfig implements CustomField {
  name: String!
  type: String!
  list: Boolean!
  length: Int
  label: [LocalizedString!]
  description: [LocalizedString!]
  readonly: Boolean
  internal: Boolean
  pattern: String
  options: [StringFieldOption!]
}

type StringFieldOption {
  value: String!
  label: [LocalizedString!]
}

type LocaleStringCustomFieldConfig implements CustomField {
  name: String!
  type: String!
  list: Boolean!
  length: Int
  label: [LocalizedString!]
  description: [LocalizedString!]
  readonly: Boolean
  internal: Boolean
  pattern: String
}

type IntCustomFieldConfig implements CustomField {
  name: String!
  type: String!
  list: Boolean!
  label: [LocalizedString!]
  description: [LocalizedString!]
  readonly: Boolean
  internal: Boolean
  min: Int
  max: Int
  step: Int
}

type FloatCustomFieldConfig implements CustomField {
  name: String!
  type: String!
  list: Boolean!
  label: [LocalizedString!]
  description: [LocalizedString!]
  readonly: Boolean
  internal: Boolean
  min: Float
  max: Float
  step: Float
}

type BooleanCustomFieldConfig implements CustomField {
  name: String!
  type: String!
  list: Boolean!
  label: [LocalizedString!]
  description: [LocalizedString!]
  readonly: Boolean
  internal: Boolean
}

"""
Expects the same validation formats as the `<input type="datetime-local">` HTML element.
See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local#Additional_attributes
"""
type DateTimeCustomFieldConfig implements CustomField {
  name: String!
  type: String!
  list: Boolean!
  label: [LocalizedString!]
  description: [LocalizedString!]
  readonly: Boolean
  internal: Boolean
  min: String
  max: String
  step: Int
}

type RelationCustomFieldConfig implements CustomField {
  name: String!
  type: String!
  list: Boolean!
  label: [LocalizedString!]
  description: [LocalizedString!]
  readonly: Boolean
  internal: Boolean
  entity: String!
  scalarFields: [String!]!
}

type LocalizedString {
  languageCode: LanguageCode!
  value: String!
}

union CustomFieldConfig =
    StringCustomFieldConfig
  | LocaleStringCustomFieldConfig
  | IntCustomFieldConfig
  | FloatCustomFieldConfig
  | BooleanCustomFieldConfig
  | DateTimeCustomFieldConfig
  | RelationCustomFieldConfig

type CustomerGroup implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  name: String!
  customers(options: CustomerListOptions): CustomerList!
}

input CustomerListOptions {
  skip: Int
  take: Int
  sort: CustomerSortParameter
  filter: CustomerFilterParameter
}

type Customer implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  title: String
  firstName: String!
  lastName: String!
  phoneNumber: String
  emailAddress: String!
  addresses: [Address!]
  orders(options: OrderListOptions): OrderList!
  user: User
  customFields: JSON
}

type CustomerList implements PaginatedList {
  items: [Customer!]!
  totalItems: Int!
}

type FacetValue implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  facet: Facet!
  name: String!
  code: String!
  translations: [FacetValueTranslation!]!
  customFields: JSON
}

type FacetValueTranslation {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
}

type Facet implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
  code: String!
  values: [FacetValue!]!
  translations: [FacetTranslation!]!
  customFields: JSON
}

type FacetTranslation {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
}

type FacetList implements PaginatedList {
  items: [Facet!]!
  totalItems: Int!
}

type HistoryEntry implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  type: HistoryEntryType!
  data: JSON!
}

enum HistoryEntryType {
  CUSTOMER_REGISTERED
  CUSTOMER_VERIFIED
  CUSTOMER_DETAIL_UPDATED
  CUSTOMER_ADDED_TO_GROUP
  CUSTOMER_REMOVED_FROM_GROUP
  CUSTOMER_ADDRESS_CREATED
  CUSTOMER_ADDRESS_UPDATED
  CUSTOMER_ADDRESS_DELETED
  CUSTOMER_PASSWORD_UPDATED
  CUSTOMER_PASSWORD_RESET_REQUESTED
  CUSTOMER_PASSWORD_RESET_VERIFIED
  CUSTOMER_EMAIL_UPDATE_REQUESTED
  CUSTOMER_EMAIL_UPDATE_VERIFIED
  CUSTOMER_NOTE
  ORDER_STATE_TRANSITION
  ORDER_PAYMENT_TRANSITION
  ORDER_FULFILLMENT
  ORDER_CANCELLATION
  ORDER_REFUND_TRANSITION
  ORDER_FULFILLMENT_TRANSITION
  ORDER_NOTE
  ORDER_COUPON_APPLIED
  ORDER_COUPON_REMOVED
  ORDER_MODIFIED
}

type HistoryEntryList implements PaginatedList {
  items: [HistoryEntry!]!
  totalItems: Int!
}

input HistoryEntryListOptions {
  skip: Int
  take: Int
  sort: HistoryEntrySortParameter
  filter: HistoryEntryFilterParameter
}

"""
@description
Languages in the form of a ISO 639-1 language code with optional
region or script modifier (e.g. de_AT). The selection available is based
on the [Unicode CLDR summary list](https://unicode-org.github.io/cldr-staging/charts/37/summary/root.html)
and includes the major spoken languages of the world and any widely-used variants.

@docsCategory common
"""
enum LanguageCode {
  """
  Afrikaans
  """
  af

  """
  Akan
  """
  ak

  """
  Albanian
  """
  sq

  """
  Amharic
  """
  am

  """
  Arabic
  """
  ar

  """
  Armenian
  """
  hy

  """
  Assamese
  """
  as

  """
  Azerbaijani
  """
  az

  """
  Bambara
  """
  bm

  """
  Bangla
  """
  bn

  """
  Basque
  """
  eu

  """
  Belarusian
  """
  be

  """
  Bosnian
  """
  bs

  """
  Breton
  """
  br

  """
  Bulgarian
  """
  bg

  """
  Burmese
  """
  my

  """
  Catalan
  """
  ca

  """
  Chechen
  """
  ce

  """
  Chinese
  """
  zh

  """
  Simplified Chinese
  """
  zh_Hans

  """
  Traditional Chinese
  """
  zh_Hant

  """
  Church Slavic
  """
  cu

  """
  Cornish
  """
  kw

  """
  Corsican
  """
  co

  """
  Croatian
  """
  hr

  """
  Czech
  """
  cs

  """
  Danish
  """
  da

  """
  Dutch
  """
  nl

  """
  Flemish
  """
  nl_BE

  """
  Dzongkha
  """
  dz

  """
  English
  """
  en

  """
  Australian English
  """
  en_AU

  """
  Canadian English
  """
  en_CA

  """
  British English
  """
  en_GB

  """
  American English
  """
  en_US

  """
  Esperanto
  """
  eo

  """
  Estonian
  """
  et

  """
  Ewe
  """
  ee

  """
  Faroese
  """
  fo

  """
  Finnish
  """
  fi

  """
  French
  """
  fr

  """
  Canadian French
  """
  fr_CA

  """
  Swiss French
  """
  fr_CH

  """
  Fulah
  """
  ff

  """
  Galician
  """
  gl

  """
  Ganda
  """
  lg

  """
  Georgian
  """
  ka

  """
  German
  """
  de

  """
  Austrian German
  """
  de_AT

  """
  Swiss High German
  """
  de_CH

  """
  Greek
  """
  el

  """
  Gujarati
  """
  gu

  """
  Haitian Creole
  """
  ht

  """
  Hausa
  """
  ha

  """
  Hebrew
  """
  he

  """
  Hindi
  """
  hi

  """
  Hungarian
  """
  hu

  """
  Icelandic
  """
  is

  """
  Igbo
  """
  ig

  """
  Indonesian
  """
  id

  """
  Interlingua
  """
  ia

  """
  Irish
  """
  ga

  """
  Italian
  """
  it

  """
  Japanese
  """
  ja

  """
  Javanese
  """
  jv

  """
  Kalaallisut
  """
  kl

  """
  Kannada
  """
  kn

  """
  Kashmiri
  """
  ks

  """
  Kazakh
  """
  kk

  """
  Khmer
  """
  km

  """
  Kikuyu
  """
  ki

  """
  Kinyarwanda
  """
  rw

  """
  Korean
  """
  ko

  """
  Kurdish
  """
  ku

  """
  Kyrgyz
  """
  ky

  """
  Lao
  """
  lo

  """
  Latin
  """
  la

  """
  Latvian
  """
  lv

  """
  Lingala
  """
  ln

  """
  Lithuanian
  """
  lt

  """
  Luba-Katanga
  """
  lu

  """
  Luxembourgish
  """
  lb

  """
  Macedonian
  """
  mk

  """
  Malagasy
  """
  mg

  """
  Malay
  """
  ms

  """
  Malayalam
  """
  ml

  """
  Maltese
  """
  mt

  """
  Manx
  """
  gv

  """
  Maori
  """
  mi

  """
  Marathi
  """
  mr

  """
  Mongolian
  """
  mn

  """
  Nepali
  """
  ne

  """
  North Ndebele
  """
  nd

  """
  Northern Sami
  """
  se

  """
  Norwegian Bokmål
  """
  nb

  """
  Norwegian Nynorsk
  """
  nn

  """
  Nyanja
  """
  ny

  """
  Odia
  """
  or

  """
  Oromo
  """
  om

  """
  Ossetic
  """
  os

  """
  Pashto
  """
  ps

  """
  Persian
  """
  fa

  """
  Dari
  """
  fa_AF

  """
  Polish
  """
  pl

  """
  Portuguese
  """
  pt

  """
  Brazilian Portuguese
  """
  pt_BR

  """
  European Portuguese
  """
  pt_PT

  """
  Punjabi
  """
  pa

  """
  Quechua
  """
  qu

  """
  Romanian
  """
  ro

  """
  Moldavian
  """
  ro_MD

  """
  Romansh
  """
  rm

  """
  Rundi
  """
  rn

  """
  Russian
  """
  ru

  """
  Samoan
  """
  sm

  """
  Sango
  """
  sg

  """
  Sanskrit
  """
  sa

  """
  Scottish Gaelic
  """
  gd

  """
  Serbian
  """
  sr

  """
  Shona
  """
  sn

  """
  Sichuan Yi
  """
  ii

  """
  Sindhi
  """
  sd

  """
  Sinhala
  """
  si

  """
  Slovak
  """
  sk

  """
  Slovenian
  """
  sl

  """
  Somali
  """
  so

  """
  Southern Sotho
  """
  st

  """
  Spanish
  """
  es

  """
  European Spanish
  """
  es_ES

  """
  Mexican Spanish
  """
  es_MX

  """
  Sundanese
  """
  su

  """
  Swahili
  """
  sw

  """
  Congo Swahili
  """
  sw_CD

  """
  Swedish
  """
  sv

  """
  Tajik
  """
  tg

  """
  Tamil
  """
  ta

  """
  Tatar
  """
  tt

  """
  Telugu
  """
  te

  """
  Thai
  """
  th

  """
  Tibetan
  """
  bo

  """
  Tigrinya
  """
  ti

  """
  Tongan
  """
  to

  """
  Turkish
  """
  tr

  """
  Turkmen
  """
  tk

  """
  Ukrainian
  """
  uk

  """
  Urdu
  """
  ur

  """
  Uyghur
  """
  ug

  """
  Uzbek
  """
  uz

  """
  Vietnamese
  """
  vi

  """
  Volapük
  """
  vo

  """
  Welsh
  """
  cy

  """
  Western Frisian
  """
  fy

  """
  Wolof
  """
  wo

  """
  Xhosa
  """
  xh

  """
  Yiddish
  """
  yi

  """
  Yoruba
  """
  yo

  """
  Zulu
  """
  zu
}

type Order implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!

  """
  The date & time that the Order was placed, i.e. the Customer
  completed the checkout and the Order is no longer "active"
  """
  orderPlacedAt: DateTime

  """
  A unique code for the Order
  """
  code: String!
  state: String!

  """
  An order is active as long as the payment process has not been completed
  """
  active: Boolean!
  customer: Customer
  shippingAddress: OrderAddress
  billingAddress: OrderAddress
  lines: [OrderLine!]!

  """
  Surcharges are arbitrary modifications to the Order total which are neither
  ProductVariants nor discounts resulting from applied Promotions. For example,
  one-off discounts based on customer interaction, or surcharges based on payment
  methods.
  """
  surcharges: [Surcharge!]!
  discounts: [Discount!]!

  """
  An array of all coupon codes applied to the Order
  """
  couponCodes: [String!]!

  """
  Promotions applied to the order. Only gets populated after the payment process has completed.
  """
  promotions: [Promotion!]!
  payments: [Payment!]
  fulfillments: [Fulfillment!]
  totalQuantity: Int!

  """
  The subTotal is the total of all OrderLines in the Order. This figure also includes any Order-level
  discounts which have been prorated (proportionally distributed) amongst the OrderItems.
  To get a total of all OrderLines which does not account for prorated discounts, use the
  sum of `OrderLine.discountedLinePrice` values.
  """
  subTotal: Int!

  """
  Same as subTotal, but inclusive of tax
  """
  subTotalWithTax: Int!
  currencyCode: CurrencyCode!
  shippingLines: [ShippingLine!]!
  shipping: Int!
  shippingWithTax: Int!

  """
  Equal to subTotal plus shipping
  """
  total: Int!

  """
  The final payable amount. Equal to subTotalWithTax plus shippingWithTax
  """
  totalWithTax: Int!

  """
  A summary of the taxes being applied to this Order
  """
  taxSummary: [OrderTaxSummary!]!
  history(options: HistoryEntryListOptions): HistoryEntryList!
  customFields: JSON
}

"""
A summary of the taxes being applied to this order, grouped
by taxRate.
"""
type OrderTaxSummary {
  """
  A description of this tax
  """
  description: String!

  """
  The taxRate as a percentage
  """
  taxRate: Float!

  """
  The total net price or OrderItems to which this taxRate applies
  """
  taxBase: Int!

  """
  The total tax being applied to the Order at this taxRate
  """
  taxTotal: Int!
}

type OrderAddress {
  fullName: String
  company: String
  streetLine1: String
  streetLine2: String
  city: String
  province: String
  postalCode: String
  country: String
  countryCode: String
  phoneNumber: String
  customFields: JSON
}

type OrderList implements PaginatedList {
  items: [Order!]!
  totalItems: Int!
}

type ShippingLine {
  shippingMethod: ShippingMethod!
  price: Int!
  priceWithTax: Int!
  discountedPrice: Int!
  discountedPriceWithTax: Int!
  discounts: [Discount!]!
}

type Discount {
  adjustmentSource: String!
  type: AdjustmentType!
  description: String!
  amount: Int!
  amountWithTax: Int!
}

type OrderItem implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  cancelled: Boolean!

  """
  The price of a single unit, excluding tax and discounts
  """
  unitPrice: Int!

  """
  The price of a single unit, including tax but excluding discounts
  """
  unitPriceWithTax: Int!

  """
  The price of a single unit including discounts, excluding tax.

  If Order-level discounts have been applied, this will not be the
  actual taxable unit price (see `proratedUnitPrice`), but is generally the
  correct price to display to customers to avoid confusion
  about the internal handling of distributed Order-level discounts.
  """
  discountedUnitPrice: Int!

  """
  The price of a single unit including discounts and tax
  """
  discountedUnitPriceWithTax: Int!

  """
  The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed)
  Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
  and refund calculations.
  """
  proratedUnitPrice: Int!

  """
  The proratedUnitPrice including tax
  """
  proratedUnitPriceWithTax: Int!
  unitTax: Int!
  taxRate: Float!
  adjustments: [Adjustment!]!
  taxLines: [TaxLine!]!
  fulfillment: Fulfillment
  refundId: ID
}

type OrderLine implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  productVariant: ProductVariant!
  featuredAsset: Asset

  """
  The price of a single unit, excluding tax and discounts
  """
  unitPrice: Int!

  """
  The price of a single unit, including tax but excluding discounts
  """
  unitPriceWithTax: Int!

  """
  Non-zero if the unitPrice has changed since it was initially added to Order
  """
  unitPriceChangeSinceAdded: Int!

  """
  Non-zero if the unitPriceWithTax has changed since it was initially added to Order
  """
  unitPriceWithTaxChangeSinceAdded: Int!

  """
  The price of a single unit including discounts, excluding tax.

  If Order-level discounts have been applied, this will not be the
  actual taxable unit price (see `proratedUnitPrice`), but is generally the
  correct price to display to customers to avoid confusion
  about the internal handling of distributed Order-level discounts.
  """
  discountedUnitPrice: Int!

  """
  The price of a single unit including discounts and tax
  """
  discountedUnitPriceWithTax: Int!

  """
  The actual unit price, taking into account both item discounts _and_ prorated (proportially-distributed)
  Order-level discounts. This value is the true economic value of the OrderItem, and is used in tax
  and refund calculations.
  """
  proratedUnitPrice: Int!

  """
  The proratedUnitPrice including tax
  """
  proratedUnitPriceWithTax: Int!
  quantity: Int!
  items: [OrderItem!]!
  taxRate: Float!

  """
  The total price of the line excluding tax and discounts.
  """
  linePrice: Int!

  """
  The total price of the line including tax bit excluding discounts.
  """
  linePriceWithTax: Int!

  """
  The price of the line including discounts, excluding tax
  """
  discountedLinePrice: Int!

  """
  The price of the line including discounts and tax
  """
  discountedLinePriceWithTax: Int!

  """
  The actual line price, taking into account both item discounts _and_ prorated (proportially-distributed)
  Order-level discounts. This value is the true economic value of the OrderLine, and is used in tax
  and refund calculations.
  """
  proratedLinePrice: Int!

  """
  The proratedLinePrice including tax
  """
  proratedLinePriceWithTax: Int!

  """
  The total tax on this line
  """
  lineTax: Int!
  discounts: [Discount!]!
  taxLines: [TaxLine!]!
  order: Order!
  customFields: JSON
}

type Payment implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  method: String!
  amount: Int!
  state: String!
  transactionId: String
  errorMessage: String
  refunds: [Refund!]!
  metadata: JSON
}

type Refund implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  items: Int!
  shipping: Int!
  adjustment: Int!
  total: Int!
  method: String
  state: String!
  transactionId: String
  reason: String
  orderItems: [OrderItem!]!
  paymentId: ID!
  metadata: JSON
}

type Fulfillment implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  orderItems: [OrderItem!]!
  state: String!
  method: String!
  trackingCode: String
  customFields: JSON
}

type Surcharge implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  description: String!
  sku: String
  taxLines: [TaxLine!]!
  price: Int!
  priceWithTax: Int!
  taxRate: Float!
}

type ProductOptionGroup implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  code: String!
  name: String!
  options: [ProductOption!]!
  translations: [ProductOptionGroupTranslation!]!
  customFields: JSON
}

type ProductOptionGroupTranslation {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
}

type ProductOption implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  code: String!
  name: String!
  groupId: ID!
  group: ProductOptionGroup!
  translations: [ProductOptionTranslation!]!
  customFields: JSON
}

type ProductOptionTranslation {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
}

type SearchReindexResponse {
  success: Boolean!
}

type SearchResponse {
  items: [SearchResult!]!
  totalItems: Int!
  facetValues: [FacetValueResult!]!
}

"""
Which FacetValues are present in the products returned
by the search, and in what quantity.
"""
type FacetValueResult {
  facetValue: FacetValue!
  count: Int!
}

type SearchResultAsset {
  id: ID!
  preview: String!
  focalPoint: Coordinate
}

type SearchResult {
  sku: String!
  slug: String!
  productId: ID!
  productName: String!
  productAsset: SearchResultAsset
  productVariantId: ID!
  productVariantName: String!
  productVariantAsset: SearchResultAsset
  price: SearchResultPrice!
  priceWithTax: SearchResultPrice!
  currencyCode: CurrencyCode!
  description: String!
  facetIds: [ID!]!
  facetValueIds: [ID!]!

  """
  An array of ids of the Collections in which this result appears
  """
  collectionIds: [ID!]!

  """
  A relevence score for the result. Differs between database implementations
  """
  score: Float!
}

"""
The price of a search result product, either as a range or as a single price
"""
union SearchResultPrice = PriceRange | SinglePrice

"""
The price value where the result has a single price
"""
type SinglePrice {
  value: Int!
}

"""
The price range where the result has more than one price
"""
type PriceRange {
  min: Int!
  max: Int!
}

type Product implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
  slug: String!
  description: String!
  featuredAsset: Asset
  assets: [Asset!]!
  variants: [ProductVariant!]!
  optionGroups: [ProductOptionGroup!]!
  facetValues: [FacetValue!]!
  translations: [ProductTranslation!]!
  collections: [Collection!]!
  customFields: JSON
}

type ProductTranslation {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
  slug: String!
  description: String!
}

type ProductList implements PaginatedList {
  items: [Product!]!
  totalItems: Int!
}

type ProductVariant implements Node {
  id: ID!
  product: Product!
  productId: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  sku: String!
  name: String!
  featuredAsset: Asset
  assets: [Asset!]!
  price: Int!
  currencyCode: CurrencyCode!
  priceWithTax: Int!
  stockLevel: String!
  taxRateApplied: TaxRate!
  taxCategory: TaxCategory!
  options: [ProductOption!]!
  facetValues: [FacetValue!]!
  translations: [ProductVariantTranslation!]!
  customFields: ProductVariantCustomFields
}

type ProductVariantTranslation {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
}

type Promotion implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  startsAt: DateTime
  endsAt: DateTime
  couponCode: String
  perCustomerUsageLimit: Int
  name: String!
  enabled: Boolean!
  conditions: [ConfigurableOperation!]!
  actions: [ConfigurableOperation!]!
}

type PromotionList implements PaginatedList {
  items: [Promotion!]!
  totalItems: Int!
}

type Role implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  code: String!
  description: String!
  permissions: [Permission!]!
  channels: [Channel!]!
}

type RoleList implements PaginatedList {
  items: [Role!]!
  totalItems: Int!
}

type ShippingMethod implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  code: String!
  name: String!
  description: String!
  fulfillmentHandlerCode: String!
  checker: ConfigurableOperation!
  calculator: ConfigurableOperation!
  translations: [ShippingMethodTranslation!]!
  customFields: JSON
}

type ShippingMethodTranslation {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  languageCode: LanguageCode!
  name: String!
  description: String!
}

type ShippingMethodList implements PaginatedList {
  items: [ShippingMethod!]!
  totalItems: Int!
}

type Tag implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  value: String!
}

type TagList implements PaginatedList {
  items: [Tag!]!
  totalItems: Int!
}

type TaxCategory implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  name: String!
  isDefault: Boolean!
}

type TaxRate implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  name: String!
  enabled: Boolean!
  value: Float!
  category: TaxCategory!
  zone: Zone!
  customerGroup: CustomerGroup
}

type TaxRateList implements PaginatedList {
  items: [TaxRate!]!
  totalItems: Int!
}

type User implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  identifier: String!
  verified: Boolean!
  roles: [Role!]!
  lastLogin: DateTime
  authenticationMethods: [AuthenticationMethod!]!
  customFields: JSON
}

type AuthenticationMethod implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  strategy: String!
}

type Zone implements Node {
  id: ID!
  createdAt: DateTime!
  updatedAt: DateTime!
  name: String!
  members: [Country!]!
}

"""
Returned when attempting to modify the contents of an Order that is not in the `AddingItems` state.
"""
type OrderModificationError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Returned when attempting to set a ShippingMethod for which the Order is not eligible
"""
type IneligibleShippingMethodError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Returned when attempting to add a Payment to an Order that is not in the `ArrangingPayment` state.
"""
type OrderPaymentStateError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Returned when attempting to add a Payment using a PaymentMethod for which the Order is not eligible.
"""
type IneligiblePaymentMethodError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  eligibilityCheckerMessage: String
}

"""
Returned when a Payment fails due to an error.
"""
type PaymentFailedError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  paymentErrorMessage: String!
}

"""
Returned when a Payment is declined by the payment provider.
"""
type PaymentDeclinedError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  paymentErrorMessage: String!
}

"""
Returned if the provided coupon code is invalid
"""
type CouponCodeInvalidError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  couponCode: String!
}

"""
Returned if the provided coupon code is invalid
"""
type CouponCodeExpiredError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  couponCode: String!
}

"""
Returned if the provided coupon code is invalid
"""
type CouponCodeLimitError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
  couponCode: String!
  limit: Int!
}

"""
Retured when attemting to set the Customer for an Order when already logged in.
"""
type AlreadyLoggedInError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Retured when attemting to register or verify a customer account without a password, when one is required.
"""
type MissingPasswordError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Retured when attemting to verify a customer account with a password, when a password has already been set.
"""
type PasswordAlreadySetError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Retured if the verification token (used to verify a Customer's email address) is either
invalid or does not match any expected tokens.
"""
type VerificationTokenInvalidError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Returned if the verification token (used to verify a Customer's email address) is valid, but has
expired according to the `verificationTokenDuration` setting in the AuthOptions.
"""
type VerificationTokenExpiredError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Retured if the token used to change a Customer's email address is either
invalid or does not match any expected tokens.
"""
type IdentifierChangeTokenInvalidError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Retured if the token used to change a Customer's email address is valid, but has
expired according to the `verificationTokenDuration` setting in the AuthOptions.
"""
type IdentifierChangeTokenExpiredError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Retured if the token used to reset a Customer's password is either
invalid or does not match any expected tokens.
"""
type PasswordResetTokenInvalidError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Retured if the token used to reset a Customer's password is valid, but has
expired according to the `verificationTokenDuration` setting in the AuthOptions.
"""
type PasswordResetTokenExpiredError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Returned if `authOptions.requireVerification` is set to `true` (which is the default)
and an unverified user attempts to authenticate.
"""
type NotVerifiedError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

"""
Returned when invoking a mutation which depends on there being an active Order on the
current session.
"""
type NoActiveOrderError implements ErrorResult {
  errorCode: ErrorCode!
  message: String!
}

input AuthenticationInput {
  native: NativeAuthInput
}

input RegisterCustomerInput {
  emailAddress: String!
  title: String
  firstName: String
  lastName: String
  phoneNumber: String
  password: String
}

input UpdateCustomerInput {
  title: String
  firstName: String
  lastName: String
  phoneNumber: String
  customFields: JSON
}

input UpdateOrderInput {
  customFields: JSON
}

"""
Passed as input to the `addPaymentToOrder` mutation.
"""
input PaymentInput {
  """
  This field should correspond to the `code` property of a PaymentMethodHandler.
  """
  method: String!

  """
  This field should contain arbitrary data passed to the specified PaymentMethodHandler's `createPayment()` method
  as the "metadata" argument. For example, it could contain an ID for the payment and other
  data generated by the payment provider.
  """
  metadata: JSON!
}

input CollectionListOptions {
  skip: Int
  take: Int
  sort: CollectionSortParameter
  filter: CollectionFilterParameter
}

input OrderListOptions {
  skip: Int
  take: Int
  sort: OrderSortParameter
  filter: OrderFilterParameter
}

input ProductListOptions {
  skip: Int
  take: Int
  sort: ProductSortParameter
  filter: ProductFilterParameter
}

union UpdateOrderItemsResult =
    Order
  | OrderModificationError
  | OrderLimitError
  | NegativeQuantityError
  | InsufficientStockError

union RemoveOrderItemsResult = Order | OrderModificationError

union SetOrderShippingMethodResult =
    Order
  | OrderModificationError
  | IneligibleShippingMethodError
  | NoActiveOrderError

union ApplyCouponCodeResult =
    Order
  | CouponCodeExpiredError
  | CouponCodeInvalidError
  | CouponCodeLimitError

union AddPaymentToOrderResult =
    Order
  | OrderPaymentStateError
  | IneligiblePaymentMethodError
  | PaymentFailedError
  | PaymentDeclinedError
  | OrderStateTransitionError
  | NoActiveOrderError

union TransitionOrderToStateResult = Order | OrderStateTransitionError

union SetCustomerForOrderResult =
    Order
  | AlreadyLoggedInError
  | EmailAddressConflictError
  | NoActiveOrderError

union RegisterCustomerAccountResult =
    Success
  | MissingPasswordError
  | NativeAuthStrategyError

union RefreshCustomerVerificationResult = Success | NativeAuthStrategyError

union VerifyCustomerAccountResult =
    CurrentUser
  | VerificationTokenInvalidError
  | VerificationTokenExpiredError
  | MissingPasswordError
  | PasswordAlreadySetError
  | NativeAuthStrategyError

union UpdateCustomerPasswordResult =
    Success
  | InvalidCredentialsError
  | NativeAuthStrategyError

union RequestUpdateCustomerEmailAddressResult =
    Success
  | InvalidCredentialsError
  | EmailAddressConflictError
  | NativeAuthStrategyError

union UpdateCustomerEmailAddressResult =
    Success
  | IdentifierChangeTokenInvalidError
  | IdentifierChangeTokenExpiredError
  | NativeAuthStrategyError

union RequestPasswordResetResult = Success | NativeAuthStrategyError

union ResetPasswordResult =
    CurrentUser
  | PasswordResetTokenInvalidError
  | PasswordResetTokenExpiredError
  | NativeAuthStrategyError

union NativeAuthenticationResult =
    CurrentUser
  | InvalidCredentialsError
  | NotVerifiedError
  | NativeAuthStrategyError

union AuthenticationResult =
    CurrentUser
  | InvalidCredentialsError
  | NotVerifiedError

union ActiveOrderResult = Order | NoActiveOrderError

input CollectionFilterParameter {
  createdAt: DateOperators
  updatedAt: DateOperators
  languageCode: StringOperators
  name: StringOperators
  slug: StringOperators
  position: NumberOperators
  description: StringOperators
}

input CollectionSortParameter {
  id: SortOrder
  createdAt: SortOrder
  updatedAt: SortOrder
  name: SortOrder
  slug: SortOrder
  position: SortOrder
  description: SortOrder
}

input ProductFilterParameter {
  createdAt: DateOperators
  updatedAt: DateOperators
  languageCode: StringOperators
  name: StringOperators
  slug: StringOperators
  description: StringOperators
}

input ProductSortParameter {
  id: SortOrder
  createdAt: SortOrder
  updatedAt: SortOrder
  name: SortOrder
  slug: SortOrder
  description: SortOrder
}

input ProductVariantFilterParameter {
  createdAt: DateOperators
  updatedAt: DateOperators
  languageCode: StringOperators
  sku: StringOperators
  name: StringOperators
  price: NumberOperators
  currencyCode: StringOperators
  priceWithTax: NumberOperators
  stockLevel: StringOperators
  discountPrice: NumberOperators
}

input ProductVariantSortParameter {
  id: SortOrder
  productId: SortOrder
  createdAt: SortOrder
  updatedAt: SortOrder
  sku: SortOrder
  name: SortOrder
  price: SortOrder
  priceWithTax: SortOrder
  stockLevel: SortOrder
  discountPrice: SortOrder
}

input CustomerFilterParameter {
  createdAt: DateOperators
  updatedAt: DateOperators
  title: StringOperators
  firstName: StringOperators
  lastName: StringOperators
  phoneNumber: StringOperators
  emailAddress: StringOperators
}

input CustomerSortParameter {
  id: SortOrder
  createdAt: SortOrder
  updatedAt: SortOrder
  title: SortOrder
  firstName: SortOrder
  lastName: SortOrder
  phoneNumber: SortOrder
  emailAddress: SortOrder
}

input OrderFilterParameter {
  createdAt: DateOperators
  updatedAt: DateOperators
  orderPlacedAt: DateOperators
  code: StringOperators
  state: StringOperators
  active: BooleanOperators
  totalQuantity: NumberOperators
  subTotal: NumberOperators
  subTotalWithTax: NumberOperators
  currencyCode: StringOperators
  shipping: NumberOperators
  shippingWithTax: NumberOperators
  total: NumberOperators
  totalWithTax: NumberOperators
}

input OrderSortParameter {
  id: SortOrder
  createdAt: SortOrder
  updatedAt: SortOrder
  orderPlacedAt: SortOrder
  code: SortOrder
  state: SortOrder
  totalQuantity: SortOrder
  subTotal: SortOrder
  subTotalWithTax: SortOrder
  shipping: SortOrder
  shippingWithTax: SortOrder
  total: SortOrder
  totalWithTax: SortOrder
}

input HistoryEntryFilterParameter {
  createdAt: DateOperators
  updatedAt: DateOperators
  type: StringOperators
}

input HistoryEntrySortParameter {
  id: SortOrder
  createdAt: SortOrder
  updatedAt: SortOrder
}

type ProductVariantCustomFields {
  discountPrice: Int
}

input NativeAuthInput {
  username: String!
  password: String!
}