Reaction Commerce GraphQL API API Reference

This represents the GraphQL API provided by Reaction Commerce with the included plugins. Note that your GraphQL API will vary depending on your mix of plugins. To explore and query the API, go to /graphql on a Reaction Commerce URL in a browser.

API Endpoints
Reaction GraphQL API:
http://api.v3.reactioncommerce.io/graphql
Contact: hello@reactioncommerce.com
Version: 3.0.0

Queries

Queries return all requested data, without any side effects

account

Returns the account with the provided ID

id:
string

The account ID

Example

Request Content-Types: application/json
Query
query account($id: ID!){
  account(id: $id){
    _id
    bio
    createdAt
    firstName
    language
    lastName
    metafields{
      description
      key
      namespace
      scope
      value
      valueType
    }
    name
    note
    picture
    preferences
    primaryEmailAddress
    updatedAt
    userId
    username
  }
}
Variables
{
  "id": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "account": {
      "_id": "string",
      "bio": "string",
      "firstName": "string",
      "language": "string",
      "lastName": "string",
      "metafields": [
        {
          "description": "string",
          "key": "string",
          "namespace": "string",
          "scope": "string",
          "value": "string",
          "valueType": "string"
        }
      ],
      "name": "string",
      "note": "string",
      "picture": "string",
      "userId": "string",
      "username": "string"
    }
  }
}

accountCartByAccountId

Find a cart for a given account ID.

accountId:
string

Account that owns the cart

shopId:
string

Shop that owns the cart

Example

Request Content-Types: application/json
Query
query accountCartByAccountId($accountId: ID!, $shopId: ID!){
  accountCartByAccountId(accountId: $accountId, shopId: $shopId){
    _id
    createdAt
    email
    expiresAt
    referenceId
    totalItemQuantity
    updatedAt
    surcharges
  }
}
Variables
{
  "accountId": "string",
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "accountCartByAccountId": {
      "_id": "string",
      "email": "string",
      "referenceId": "string",
      "totalItemQuantity": "integer"
    }
  }
}

accounts

Returns accounts optionally filtered by account groups

groupIds:
string[]

Return only accounts in any of these groups

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

sortOrder:

Return results sorted in this order

By default, groups are sorted by when they were created, oldest first. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query accounts($groupIds: [ID], $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int, $sortOrder: SortOrder, $sortBy: AccountSortByField){
  accounts(groupIds: $groupIds, after: $after, before: $before, first: $first, last: $last, offset: $offset, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        bio
        createdAt
        firstName
        language
        lastName
        metafields{
          description
          key
          namespace
          scope
          value
          valueType
        }
        name
        note
        picture
        preferences
        primaryEmailAddress
        updatedAt
        userId
        username
      }
    }
    nodes{
      _id
      bio
      createdAt
      firstName
      language
      lastName
      metafields{
        ...RecursiveMetafieldFragment
      }
      name
      note
      picture
      preferences
      primaryEmailAddress
      updatedAt
      userId
      username
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "groupIds": [
    "string"
  ],
  "offset": "integer",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "accounts": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "bio": "string",
            "firstName": "string",
            "language": "string",
            "lastName": "string",
            "metafields": [
              {
                "description": "string",
                "key": "string",
                "namespace": "string",
                "scope": "string",
                "value": "string",
                "valueType": "string"
              }
            ],
            "name": "string",
            "note": "string",
            "picture": "string",
            "userId": "string",
            "username": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "bio": "string",
          "firstName": "string",
          "language": "string",
          "lastName": "string",
          "metafields": [
            {
              "description": "string",
              "key": "string",
              "namespace": "string",
              "scope": "string",
              "value": "string",
              "valueType": "string"
            }
          ],
          "name": "string",
          "note": "string",
          "picture": "string",
          "userId": "string",
          "username": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

addressValidation

Get a list of errors and suggested properly formatted addresses for an address. If no address validation service is active for the shop, this will return as if the address is valid even though no check actually occurred.

address:

Address to validate

shopId:
string

Shop to use for determining what validation service to use

Example

Request Content-Types: application/json
Query
query addressValidation($address: AddressInput!, $shopId: ID!){
  addressValidation(address: $address, shopId: $shopId){
    suggestedAddresses
    validationErrors
  }
}
Variables
{
  "address": {
    "address1": "string",
    "address2": "string",
    "addressName": "string",
    "city": "string",
    "company": "string",
    "country": "string",
    "firstName": "string",
    "fullName": "string",
    "isBillingDefault": "boolean",
    "isCommercial": "boolean",
    "isShippingDefault": "boolean",
    "lastName": "string",
    "metafields": [
      {
        "description": "string",
        "key": "string",
        "namespace": "string",
        "scope": "string",
        "value": "string",
        "valueType": "string"
      }
    ],
    "phone": "string",
    "postal": "string",
    "region": "string"
  },
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addressValidation": {}
  }
}

addressValidationRules

Returns a list of defined address validation rules for a shop

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

serviceNames:
string[]

An optional list of service names, to get only rules that specify one of these services

shopId:
string

ID of the shop for which to get defined address validation rules

sortOrder:

Return results sorted in this order

By default, rules are sorted by when they were created, oldest first. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query addressValidationRules($after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int, $serviceNames: [String], $shopId: ID!, $sortOrder: SortOrder, $sortBy: AddressValidationRuleSortByField){
  addressValidationRules(after: $after, before: $before, first: $first, last: $last, offset: $offset, serviceNames: $serviceNames, shopId: $shopId, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        countryCodes
        createdAt
        serviceName
        shopId
        updatedAt
      }
    }
    nodes{
      _id
      countryCodes
      createdAt
      serviceName
      shopId
      updatedAt
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "offset": "integer",
  "serviceNames": [
    "string"
  ],
  "shopId": "string",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addressValidationRules": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "countryCodes": [
              "string"
            ],
            "serviceName": "string",
            "shopId": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "countryCodes": [
            "string"
          ],
          "serviceName": "string",
          "shopId": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

addressValidationServices

Get a full list of all registered address validation services

Example

Request Content-Types: application/json
Query
query addressValidationServices{
  addressValidationServices
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addressValidationServices": [
      {
        "displayName": "string",
        "name": "string",
        "supportedCountryCodes": [
          "string"
        ]
      }
    ]
  }
}

anonymousCartByCartId

Finds a cart by the cart ID and anonymous cart token.

cartId:
string

The cart ID. Must be an anonymous cart (that is, one with no linked account).

cartToken:
string

A valid anonymous cart access cartToken for this cart. This is returned when you create an anonymous cart and should be stored securely in storefront client storage.

Example

Request Content-Types: application/json
Query
query anonymousCartByCartId($cartId: ID!, $cartToken: String!){
  anonymousCartByCartId(cartId: $cartId, cartToken: $cartToken){
    _id
    createdAt
    email
    expiresAt
    referenceId
    totalItemQuantity
    updatedAt
    surcharges
  }
}
Variables
{
  "cartId": "string",
  "cartToken": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "anonymousCartByCartId": {
      "_id": "string",
      "email": "string",
      "referenceId": "string",
      "totalItemQuantity": "integer"
    }
  }
}

availablePaymentMethods

Get a list of all payment methods available during a checkout. This may filter by auth, active/inactive, IP/region, shop, etc. To get the full list, use the paymentMethods query with proper authorization.

shopId:
string

ID of the shop for which the order will be placed

Example

Request Content-Types: application/json
Query
query availablePaymentMethods($shopId: ID!){
  availablePaymentMethods(shopId: $shopId)
}
Variables
{
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "availablePaymentMethods": [
      {
        "canRefund": "boolean",
        "displayName": "string",
        "isEnabled": "boolean",
        "name": "string",
        "pluginName": "string"
      }
    ]
  }
}

catalogItemProduct

Gets product from catalog

shopId:
string

ID of the shop that owns the catalog product. Not required but highly recommended if you have multiple shops and slugOrId is a slug because slugs are unique only within a shop.

slugOrId:
string

Provide either a product ID or slug

Example

Request Content-Types: application/json
Query
query catalogItemProduct($shopId: ID, $slugOrId: String){
  catalogItemProduct(shopId: $shopId, slugOrId: $slugOrId){
    _id
    createdAt
    updatedAt
  }
}
Variables
{
  "shopId": "string",
  "slugOrId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "catalogItemProduct": {
      "_id": "string"
    }
  }
}

catalogItems

Gets items from a shop catalog

shopIds:
string[]

Provide a list of shop IDs from which you want to get catalog items

tagIds:
string[]

Optionally provide a list of tag IDs to further filter the item list

booleanFilters:

Additional filters to apply

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

sortOrder:

Return results sorted in this order

sortByPriceCurrencyCode:
string

Provide a Currency code if sortBy is minPrice

By default, items are sorted by when they were last updated, most recently updated first. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query catalogItems($shopIds: [ID]!, $tagIds: [ID], $booleanFilters: [CatalogBooleanFilter], $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int, $sortOrder: SortOrder, $sortByPriceCurrencyCode: String, $sortBy: CatalogItemSortByField){
  catalogItems(shopIds: $shopIds, tagIds: $tagIds, booleanFilters: $booleanFilters, after: $after, before: $before, first: $first, last: $last, offset: $offset, sortOrder: $sortOrder, sortByPriceCurrencyCode: $sortByPriceCurrencyCode, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        createdAt
        updatedAt
      }
    }
    nodes{
      _id
      createdAt
      updatedAt
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopIds": [
    "string"
  ],
  "tagIds": [
    "string"
  ],
  "booleanFilters": [
    {
      "name": "string",
      "value": "boolean"
    }
  ],
  "offset": "integer",
  "sortOrder": "string",
  "sortByPriceCurrencyCode": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "catalogItems": {
      "edges": [
        {}
      ],
      "nodes": [
        null
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

discountCodes

Gets discount codes

shopId:
string

Provide a shop ID from which you want to get discount codes

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

Example

Request Content-Types: application/json
Query
query discountCodes($shopId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int){
  discountCodes(shopId: $shopId, after: $after, before: $before, first: $first, last: $last, offset: $offset){
    edges{
      cursor
      node{
        _id
        code
        description
        discount
        discountMethod
        label
      }
    }
    nodes{
      _id
      code
      description
      discount
      discountMethod
      label
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "offset": "integer"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "discountCodes": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "code": "string",
            "description": "string",
            "discount": "string",
            "label": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "code": "string",
          "description": "string",
          "discount": "string",
          "label": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

emailTemplates

Retrieves a list of email templates

shopId:
string

The shopId to which email templates belong to

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

Example

Request Content-Types: application/json
Query
query emailTemplates($shopId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int){
  emailTemplates(shopId: $shopId, after: $after, before: $before, first: $first, last: $last, offset: $offset){
    edges{
      cursor
      node{
        _id
        language
        name
        shopId
        subject
        template
        title
      }
    }
    nodes{
      _id
      language
      name
      shopId
      subject
      template
      title
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "offset": "integer"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "emailTemplates": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "language": "string",
            "name": "string",
            "shopId": "string",
            "subject": "string",
            "template": "string",
            "title": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "language": "string",
          "name": "string",
          "shopId": "string",
          "subject": "string",
          "template": "string",
          "title": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

flatRateFulfillmentMethod

Get a flat rate fulfillment method

methodId:
string

Fulfillment method id

shopId:
string

Shop ID

Example

Request Content-Types: application/json
Query
query flatRateFulfillmentMethod($methodId: ID!, $shopId: ID!){
  flatRateFulfillmentMethod(methodId: $methodId, shopId: $shopId){
    _id
    cost
    fulfillmentTypes
    group
    handling
    isEnabled
    label
    name
    rate
  }
}
Variables
{
  "methodId": "string",
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "flatRateFulfillmentMethod": {
      "_id": "string",
      "cost": "number",
      "fulfillmentTypes": [
        null
      ],
      "group": "string",
      "handling": "number",
      "isEnabled": "boolean",
      "label": "string",
      "name": "string",
      "rate": "number"
    }
  }
}

flatRateFulfillmentMethods

Get a flat rate fulfillment methods

shopId:
string

Shop ID

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

Example

Request Content-Types: application/json
Query
query flatRateFulfillmentMethods($shopId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int){
  flatRateFulfillmentMethods(shopId: $shopId, after: $after, before: $before, first: $first, last: $last, offset: $offset){
    edges{
      cursor
      node{
        _id
        cost
        fulfillmentTypes
        group
        handling
        isEnabled
        label
        name
        rate
      }
    }
    nodes{
      _id
      cost
      fulfillmentTypes
      group
      handling
      isEnabled
      label
      name
      rate
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "offset": "integer"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "flatRateFulfillmentMethods": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "cost": "number",
            "fulfillmentTypes": [
              null
            ],
            "group": "string",
            "handling": "number",
            "isEnabled": "boolean",
            "label": "string",
            "name": "string",
            "rate": "number"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "cost": "number",
          "fulfillmentTypes": [
            null
          ],
          "group": "string",
          "handling": "number",
          "isEnabled": "boolean",
          "label": "string",
          "name": "string",
          "rate": "number"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

getFlatRateFulfillmentRestriction

Get a single flat rate fulfillment method restriction.

restrictionId:
string

The restriction ID

shopId:
string

Shop that owns the restriction

Example

Request Content-Types: application/json
Query
query getFlatRateFulfillmentRestriction($restrictionId: ID!, $shopId: ID!){
  getFlatRateFulfillmentRestriction(restrictionId: $restrictionId, shopId: $shopId){
    _id
    methodIds
    shopId
    type
  }
}
Variables
{
  "restrictionId": "string",
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "getFlatRateFulfillmentRestriction": {
      "_id": "string",
      "methodIds": [
        "string"
      ],
      "shopId": "string"
    }
  }
}

getFlatRateFulfillmentRestrictions

Get the full list of flat rate fulfillment method restrictions.

shopId:
string

Shop to get restrictions for

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

sortOrder:

Return results sorted in this order

By default, restrictions are sorted by when they were created, newest first. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query getFlatRateFulfillmentRestrictions($shopId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $sortOrder: SortOrder, $sortBy: FlatRateFulfillmentRestrictionSortByField){
  getFlatRateFulfillmentRestrictions(shopId: $shopId, after: $after, before: $before, first: $first, last: $last, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        methodIds
        shopId
        type
      }
    }
    nodes{
      _id
      methodIds
      shopId
      type
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "getFlatRateFulfillmentRestrictions": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "methodIds": [
              "string"
            ],
            "shopId": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "methodIds": [
            "string"
          ],
          "shopId": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

globalSettings

Returns app settings that are not shop specific. Plugins extend the GlobalSettings type to support whatever settings they need.

Example

Request Content-Types: application/json
Query
query globalSettings{
  globalSettings{
    doNotUse
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "globalSettings": {
      "doNotUse": "string"
    }
  }
}

group

Returns a single group by ID.

id:
string

The group ID

Example

Request Content-Types: application/json
Query
query group($id: ID!){
  group(id: $id){
    _id
    createdAt
    description
    name
    permissions
    slug
    updatedAt
  }
}
Variables
{
  "id": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "group": {
      "_id": "string",
      "description": "string",
      "name": "string",
      "permissions": [
        "string"
      ],
      "slug": "string"
    }
  }
}

groups

Returns a list of groups for the shop with ID shopId, as a Relay-compatible connection.

shopId:
string

Return groups for this shop

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

sortOrder:

Return results sorted in this order

By default, groups are sorted by when they were created, oldest first. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query groups($shopId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $sortOrder: SortOrder, $sortBy: GroupSortByField){
  groups(shopId: $shopId, after: $after, before: $before, first: $first, last: $last, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        createdAt
        description
        name
        permissions
        slug
        updatedAt
      }
    }
    nodes{
      _id
      createdAt
      description
      name
      permissions
      slug
      updatedAt
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "groups": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "description": "string",
            "name": "string",
            "permissions": [
              "string"
            ],
            "slug": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "description": "string",
          "name": "string",
          "permissions": [
            "string"
          ],
          "slug": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

navigationItemsByShopId

Returns the navigation items for a shop

shopId:
string

The ID of the shop to load navigation items for

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

sortOrder:

Return results sorted in this order

By default, items are sorted by when they were created, newest first. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query navigationItemsByShopId($shopId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int, $sortOrder: SortOrder, $sortBy: NavigationItemSortByField){
  navigationItemsByShopId(shopId: $shopId, after: $after, before: $before, first: $first, last: $last, offset: $offset, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        createdAt
        hasUnpublishedChanges
        metadata
        shopId
      }
    }
    nodes{
      _id
      createdAt
      hasUnpublishedChanges
      metadata
      shopId
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "offset": "integer",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "navigationItemsByShopId": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "hasUnpublishedChanges": "boolean",
            "shopId": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "hasUnpublishedChanges": "boolean",
          "shopId": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

navigationTreeById

Returns a navigation tree by its ID in the specified language

id:
string

The ID of the navigation tee

language:
string

Navigation language

shopId:
string

The ID of the shop to load navigation tree for

shouldIncludeSecondary:
boolean

Set to true if you want to include secondary navigation items along with the primary items

Example

Request Content-Types: application/json
Query
query navigationTreeById($id: ID!, $language: String!, $shopId: ID!, $shouldIncludeSecondary: Boolean){
  navigationTreeById(id: $id, language: $language, shopId: $shopId, shouldIncludeSecondary: $shouldIncludeSecondary){
    _id
    hasUnpublishedChanges
    name
    shopId
  }
}
Variables
{
  "id": "string",
  "language": "string",
  "shopId": "string",
  "shouldIncludeSecondary": "boolean"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "navigationTreeById": {
      "_id": "string",
      "hasUnpublishedChanges": "boolean",
      "name": "string",
      "shopId": "string"
    }
  }
}

orderById

Get an order by its ID

id:
string

The order ID

shopId:
string

The shop that owns the order

token:
string

A valid anonymous access token for this order. Required if the order is not linked with an account.

Example

Request Content-Types: application/json
Query
query orderById($id: ID!, $shopId: ID!, $token: String){
  orderById(id: $id, shopId: $shopId, token: $token){
    _id
    cartId
    createdAt
    displayStatus(language: $language)
    email
    fulfillmentGroups
    notes
    referenceId
    status
    totalItemQuantity
    updatedAt
    surcharges
  }
}
Variables
{
  "id": "string",
  "shopId": "string",
  "token": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "orderById": {
      "_id": "string",
      "cartId": "string",
      "displayStatus": "string",
      "email": "string",
      "referenceId": "string",
      "status": "string",
      "totalItemQuantity": "integer"
    }
  }
}

orderByReferenceId

Get an order by its reference ID (the ID shown to customers)

id:
string

The order reference ID (the ID shown to customers)

shopId:
string

The shop that owns the order

token:
string

A valid anonymous access token for this order. Required if the order is not linked with an account.

Example

Request Content-Types: application/json
Query
query orderByReferenceId($id: ID!, $shopId: ID!, $token: String){
  orderByReferenceId(id: $id, shopId: $shopId, token: $token){
    _id
    cartId
    createdAt
    displayStatus(language: $language)
    email
    fulfillmentGroups
    notes
    referenceId
    status
    totalItemQuantity
    updatedAt
    surcharges
  }
}
Variables
{
  "id": "string",
  "shopId": "string",
  "token": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "orderByReferenceId": {
      "_id": "string",
      "cartId": "string",
      "displayStatus": "string",
      "email": "string",
      "referenceId": "string",
      "status": "string",
      "totalItemQuantity": "integer"
    }
  }
}

orders

Get all orders for a single account, optionally limited to certain shop IDs and certain orderStatus

Filters to apply to a list of orders

shopIds:
string[]

Provide a list of shop IDs from which you want to get orders from

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

sortOrder:

Return results sorted in this order

By default, orders are sorted by when they were created, newest first. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query orders($filters: OrderFilterInput, $shopIds: [ID], $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int, $sortOrder: SortOrder, $sortBy: OrdersSortByField){
  orders(filters: $filters, shopIds: $shopIds, after: $after, before: $before, first: $first, last: $last, offset: $offset, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        cartId
        createdAt
        displayStatus(language: $language)
        email
        fulfillmentGroups
        notes
        referenceId
        status
        totalItemQuantity
        updatedAt
        surcharges
      }
    }
    nodes{
      _id
      cartId
      createdAt
      displayStatus(language: $language)
      email
      fulfillmentGroups
      notes
      referenceId
      status
      totalItemQuantity
      updatedAt
      surcharges
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "filters": {
    "createdAt": {
      "gte": "object",
      "lte": "object"
    },
    "fulfillmentStatus": [
      "string"
    ],
    "paymentStatus": [
      "string"
    ],
    "searchField": "string",
    "status": "string"
  },
  "shopIds": [
    "string"
  ],
  "offset": "integer",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "orders": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "cartId": "string",
            "displayStatus": "string",
            "email": "string",
            "referenceId": "string",
            "status": "string",
            "totalItemQuantity": "integer"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "cartId": "string",
          "displayStatus": "string",
          "email": "string",
          "referenceId": "string",
          "status": "string",
          "totalItemQuantity": "integer"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

ordersByAccountId

Get all orders for a single account, optionally limited to certain shop IDs and certain orderStatus

accountId:
string

Limit to orders placed by this account

orderStatus:
string[]

Limit to orders with one of these statuses

shopIds:
string[]

Limit to orders owned by one of these shops

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

sortOrder:

Return results sorted in this order

By default, orders are sorted by when they were created, newest first. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query ordersByAccountId($accountId: ID!, $orderStatus: [String], $shopIds: [ID]!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $sortOrder: SortOrder, $sortBy: OrdersByAccountIdSortByField){
  ordersByAccountId(accountId: $accountId, orderStatus: $orderStatus, shopIds: $shopIds, after: $after, before: $before, first: $first, last: $last, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        cartId
        createdAt
        displayStatus(language: $language)
        email
        fulfillmentGroups
        notes
        referenceId
        status
        totalItemQuantity
        updatedAt
        surcharges
      }
    }
    nodes{
      _id
      cartId
      createdAt
      displayStatus(language: $language)
      email
      fulfillmentGroups
      notes
      referenceId
      status
      totalItemQuantity
      updatedAt
      surcharges
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "accountId": "string",
  "orderStatus": [
    "string"
  ],
  "shopIds": [
    "string"
  ],
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "ordersByAccountId": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "cartId": "string",
            "displayStatus": "string",
            "email": "string",
            "referenceId": "string",
            "status": "string",
            "totalItemQuantity": "integer"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "cartId": "string",
          "displayStatus": "string",
          "email": "string",
          "referenceId": "string",
          "status": "string",
          "totalItemQuantity": "integer"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

paymentMethods

Get a full list of all payment methods

shopId:
string

The shop to get payment methods for

Example

Request Content-Types: application/json
Query
query paymentMethods($shopId: ID!){
  paymentMethods(shopId: $shopId)
}
Variables
{
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "paymentMethods": [
      {
        "canRefund": "boolean",
        "displayName": "string",
        "isEnabled": "boolean",
        "name": "string",
        "pluginName": "string"
      }
    ]
  }
}

ping

A test query

Example

Request Content-Types: application/json
Query
query ping{
  ping
}
Try it now
200 OK

Successful operation

type
string
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "ping": "string"
  }
}

primaryShop

Returns the primary shop for the domain

Example

Request Content-Types: application/json
Query
query primaryShop{
  primaryShop{
    _id
    allowGuestCheckout
    defaultNavigationTreeId
    description
    keywords
    language
    name
    slug
    timezone
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "primaryShop": {
      "_id": "string",
      "allowGuestCheckout": "boolean",
      "defaultNavigationTreeId": "string",
      "description": "string",
      "keywords": "string",
      "language": "string",
      "name": "string",
      "slug": "string",
      "timezone": "string"
    }
  }
}

primaryShopId

Returns the ID of the primary shop for the domain

Example

Request Content-Types: application/json
Query
query primaryShopId{
  primaryShopId
}
Try it now
200 OK

Successful operation

type
string
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "primaryShopId": "string"
  }
}

product

Query for a single Product

productId:
string

Product ID

shopId:
string

Shop ID

Example

Request Content-Types: application/json
Query
query product($productId: ID!, $shopId: ID!){
  product(productId: $productId, shopId: $shopId){
    _id
    createdAt
    currentProductHash
    description
    isDeleted
    isVisible
    metaDescription
    metafields
    originCountry
    pageTitle
    productType
    publishedAt
    publishedProductHash
    slug
    supportedFulfillmentTypes
    tagIds
    title
    updatedAt
    variants(shouldIncludeHidden: $shouldIncludeHidden, shouldIncludeArchived: $shouldIncludeArchived)
    vendor
    price{
      max
      min
      range
    }
  }
}
Variables
{
  "productId": "string",
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "product": {
      "_id": "string",
      "currentProductHash": "string",
      "description": "string",
      "isDeleted": "boolean",
      "isVisible": "boolean",
      "metaDescription": "string",
      "metafields": [
        {
          "description": "string",
          "key": "string",
          "namespace": "string",
          "scope": "string",
          "value": "string",
          "valueType": "string"
        }
      ],
      "originCountry": "string",
      "pageTitle": "string",
      "productType": "string",
      "publishedProductHash": "string",
      "slug": "string",
      "supportedFulfillmentTypes": [
        null
      ],
      "tagIds": [
        "string"
      ],
      "title": "string",
      "vendor": "string",
      "price": {
        "max": "number",
        "min": "number",
        "range": "string"
      }
    }
  }
}

products

Query for a list of Products

isArchived:
boolean

Filter by archived

isVisible:
boolean

Filter by visibility

metafieldKey:
string

Filter by metafield key

metafieldValue:
string

Filter by metafield value

priceMax:
number

Filter by price range maximum value

priceMin:
number

Filter by price range minimum value

productIds:
string[]

List of product IDs to filter by

query:
string

Regex metch query string

shopIds:
string[]

List of shop IDs to filter by

tagIds:
string[]

List of tag ids to filter by

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

sortOrder:

Return results sorted in this order

By default, products are sorted by createdAt. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query products($isArchived: Boolean, $isVisible: Boolean, $metafieldKey: String, $metafieldValue: String, $priceMax: Float, $priceMin: Float, $productIds: [ID], $query: String, $shopIds: [ID]!, $tagIds: [ID], $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int, $sortOrder: SortOrder, $sortBy: ProductSortByField){
  products(isArchived: $isArchived, isVisible: $isVisible, metafieldKey: $metafieldKey, metafieldValue: $metafieldValue, priceMax: $priceMax, priceMin: $priceMin, productIds: $productIds, query: $query, shopIds: $shopIds, tagIds: $tagIds, after: $after, before: $before, first: $first, last: $last, offset: $offset, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        createdAt
        currentProductHash
        description
        isDeleted
        isVisible
        metaDescription
        metafields
        originCountry
        pageTitle
        productType
        publishedAt
        publishedProductHash
        slug
        supportedFulfillmentTypes
        tagIds
        title
        updatedAt
        variants(shouldIncludeHidden: $shouldIncludeHidden, shouldIncludeArchived: $shouldIncludeArchived)
        vendor
        price{
          max
          min
          range
        }
      }
    }
    nodes{
      _id
      createdAt
      currentProductHash
      description
      isDeleted
      isVisible
      metaDescription
      metafields
      originCountry
      pageTitle
      productType
      publishedAt
      publishedProductHash
      slug
      supportedFulfillmentTypes
      tagIds
      title
      updatedAt
      variants(shouldIncludeHidden: $shouldIncludeHidden, shouldIncludeArchived: $shouldIncludeArchived)
      vendor
      price{
        ...RecursiveProductPriceRangeFragment
      }
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "isArchived": "boolean",
  "isVisible": "boolean",
  "metafieldKey": "string",
  "metafieldValue": "string",
  "priceMax": "number",
  "priceMin": "number",
  "productIds": [
    "string"
  ],
  "query": "string",
  "shopIds": [
    "string"
  ],
  "tagIds": [
    "string"
  ],
  "offset": "integer",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "products": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "currentProductHash": "string",
            "description": "string",
            "isDeleted": "boolean",
            "isVisible": "boolean",
            "metaDescription": "string",
            "metafields": [
              {
                "description": "string",
                "key": "string",
                "namespace": "string",
                "scope": "string",
                "value": "string",
                "valueType": "string"
              }
            ],
            "originCountry": "string",
            "pageTitle": "string",
            "productType": "string",
            "publishedProductHash": "string",
            "slug": "string",
            "supportedFulfillmentTypes": [
              null
            ],
            "tagIds": [
              "string"
            ],
            "title": "string",
            "vendor": "string",
            "price": {
              "max": "number",
              "min": "number",
              "range": "string"
            }
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "currentProductHash": "string",
          "description": "string",
          "isDeleted": "boolean",
          "isVisible": "boolean",
          "metaDescription": "string",
          "metafields": [
            {
              "description": "string",
              "key": "string",
              "namespace": "string",
              "scope": "string",
              "value": "string",
              "valueType": "string"
            }
          ],
          "originCountry": "string",
          "pageTitle": "string",
          "productType": "string",
          "publishedProductHash": "string",
          "slug": "string",
          "supportedFulfillmentTypes": [
            null
          ],
          "tagIds": [
            "string"
          ],
          "title": "string",
          "vendor": "string",
          "price": {
            "max": "number",
            "min": "number",
            "range": "string"
          }
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

productsByTagId

Returns a list of product in a tag

shopId:
string

Shop that owns the tag

tagId:
string

The tag ID

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

Example

Request Content-Types: application/json
Query
query productsByTagId($shopId: ID!, $tagId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt){
  productsByTagId(shopId: $shopId, tagId: $tagId, after: $after, before: $before, first: $first, last: $last){
    edges{
      cursor
      node{
        _id
        createdAt
        position
        title
      }
    }
    nodes{
      _id
      createdAt
      position
      title
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "tagId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "productsByTagId": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "position": "integer",
            "title": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "position": "integer",
          "title": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

refunds

Get refunds applied to an order by order ID

orderId:
string

The order ID

shopId:
string

The shop that owns the order

token:
string

A valid anonymous access token for this order. Required if the order is not linked with an account.

Example

Request Content-Types: application/json
Query
query refunds($orderId: ID!, $shopId: ID!, $token: String){
  refunds(orderId: $orderId, shopId: $shopId, token: $token){
    _id
    createdAt
    paymentDisplayName
    paymentId
    reason
  }
}
Variables
{
  "orderId": "string",
  "shopId": "string",
  "token": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "refunds": [
      {
        "_id": "string",
        "paymentDisplayName": "string",
        "paymentId": "string",
        "reason": "string"
      }
    ]
  }
}

refundsByPaymentId

Get refunds applied to a specific payment by payment ID

orderId:
string

The order ID

paymentId:
string

The ID of one of the payments made for this order

shopId:
string

The shop that owns the order

token:
string

A valid anonymous access token for this order. Required if the order is not linked with an account.

Example

Request Content-Types: application/json
Query
query refundsByPaymentId($orderId: ID!, $paymentId: ID!, $shopId: ID!, $token: String){
  refundsByPaymentId(orderId: $orderId, paymentId: $paymentId, shopId: $shopId, token: $token){
    _id
    createdAt
    paymentDisplayName
    paymentId
    reason
  }
}
Variables
{
  "orderId": "string",
  "paymentId": "string",
  "shopId": "string",
  "token": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "refundsByPaymentId": [
      {
        "_id": "string",
        "paymentDisplayName": "string",
        "paymentId": "string",
        "reason": "string"
      }
    ]
  }
}

roles

Returns a paged list of all roles associated with a shop

shopId:
string

Return valid roles for this shop

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

sortOrder:

Return results sorted in this order

By default, roles are sorted alphabetically by name. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query roles($shopId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $sortOrder: SortOrder, $sortBy: RoleSortByField){
  roles(shopId: $shopId, after: $after, before: $before, first: $first, last: $last, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        name
      }
    }
    nodes{
      _id
      name
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "roles": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "name": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "name": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

shop

Returns a shop by ID

id:
string

The shop ID

Example

Request Content-Types: application/json
Query
query shop($id: ID!){
  shop(id: $id){
    _id
    allowGuestCheckout
    defaultNavigationTreeId
    description
    keywords
    language
    name
    slug
    timezone
  }
}
Variables
{
  "id": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "shop": {
      "_id": "string",
      "allowGuestCheckout": "boolean",
      "defaultNavigationTreeId": "string",
      "description": "string",
      "keywords": "string",
      "language": "string",
      "name": "string",
      "slug": "string",
      "timezone": "string"
    }
  }
}

shopBySlug

Returns a shop by slug

slug:
string

The shop slug

Example

Request Content-Types: application/json
Query
query shopBySlug($slug: String!){
  shopBySlug(slug: $slug){
    _id
    allowGuestCheckout
    defaultNavigationTreeId
    description
    keywords
    language
    name
    slug
    timezone
  }
}
Variables
{
  "slug": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "shopBySlug": {
      "_id": "string",
      "allowGuestCheckout": "boolean",
      "defaultNavigationTreeId": "string",
      "description": "string",
      "keywords": "string",
      "language": "string",
      "name": "string",
      "slug": "string",
      "timezone": "string"
    }
  }
}

shopSettings

Returns app settings for a specific shop. Plugins extend the ShopSettings type to support whatever settings they need.

shopId:
string

The shop to get app settings for

Example

Request Content-Types: application/json
Query
query shopSettings($shopId: ID!){
  shopSettings(shopId: $shopId){
    doNotUse
    canSellVariantWithoutInventory
    isShippingRatesFulfillmentEnabled
    defaultTaxCode
    fallbackTaxServiceName
    primaryTaxServiceName
    shouldNavigationTreeItemsBeAdminOnly
    shouldNavigationTreeItemsBePubliclyVisible
    shouldNavigationTreeItemsBeSecondaryNavOnly
    sitemapRefreshPeriod
  }
}
Variables
{
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "shopSettings": {
      "doNotUse": "string",
      "canSellVariantWithoutInventory": "boolean",
      "isShippingRatesFulfillmentEnabled": "boolean",
      "defaultTaxCode": "string",
      "fallbackTaxServiceName": "string",
      "primaryTaxServiceName": "string",
      "shouldNavigationTreeItemsBeAdminOnly": "boolean",
      "shouldNavigationTreeItemsBePubliclyVisible": "boolean",
      "shouldNavigationTreeItemsBeSecondaryNavOnly": "boolean",
      "sitemapRefreshPeriod": "string"
    }
  }
}

simpleInventory

Get the SimpleInventory info for a product configuration. Returns null if updateSimpleInventory has never been called for this product configuration.

shopId:
string

ID of the shop that owns the product

productConfiguration:

The product configuration for which you want inventory info

Example

Request Content-Types: application/json
Query
query simpleInventory($shopId: ID!, $productConfiguration: ProductConfigurationInput!){
  simpleInventory(shopId: $shopId, productConfiguration: $productConfiguration){
    canBackorder
    inventoryInStock
    inventoryReserved
    isEnabled
    lowInventoryWarningThreshold
  }
}
Variables
{
  "shopId": "string",
  "productConfiguration": {
    "productId": "object",
    "productVariantId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "simpleInventory": {
      "canBackorder": "boolean",
      "inventoryInStock": "integer",
      "inventoryReserved": "integer",
      "isEnabled": "boolean",
      "lowInventoryWarningThreshold": "integer"
    }
  }
}

sitemap

Returns Sitemap object for a shop based on the handle param

handle:
string

The sitemap handle

shopUrl:
string

Shop URL

Example

Request Content-Types: application/json
Query
query sitemap($handle: String!, $shopUrl: String!){
  sitemap(handle: $handle, shopUrl: $shopUrl){
    createdAt
    handle
    shopId
    xml
  }
}
Variables
{
  "handle": "string",
  "shopUrl": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "sitemap": {
      "handle": "string",
      "shopId": "string",
      "xml": "string"
    }
  }
}

surchargeById

Get a single surcharge definition by its ID

shopId:
string

ID of shop that owns the surcharge definition

surchargeId:
string

The surcharge ID

Example

Request Content-Types: application/json
Query
query surchargeById($shopId: ID!, $surchargeId: ID!){
  surchargeById(shopId: $shopId, surchargeId: $surchargeId){
    _id
    message(language: $language)
    methodIds
    shopId
    type
  }
}
Variables
{
  "shopId": "string",
  "surchargeId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "surchargeById": {
      "_id": "string",
      "message": "string",
      "methodIds": [
        "string"
      ],
      "shopId": "string"
    }
  }
}

surcharges

Get the full list of surcharges.

shopId:
string

ID of shop to get surcharges for

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

sortOrder:

Return results sorted in this order

By default, surcharges are sorted by when they were created, newest first. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query surcharges($shopId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $sortOrder: SortOrder, $sortBy: SurchargeSortByField){
  surcharges(shopId: $shopId, after: $after, before: $before, first: $first, last: $last, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        message(language: $language)
        methodIds
        shopId
        type
      }
    }
    nodes{
      _id
      message(language: $language)
      methodIds
      shopId
      type
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "surcharges": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "message": "string",
            "methodIds": [
              "string"
            ],
            "shopId": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "message": "string",
          "methodIds": [
            "string"
          ],
          "shopId": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

systemInformation

SystemInformation object

shopId:
string

Shop ID to use for shop-specific system information

Example

Request Content-Types: application/json
Query
query systemInformation($shopId: ID!){
  systemInformation(shopId: $shopId){
    apiVersion
  }
}
Variables
{
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "systemInformation": {
      "apiVersion": "string"
    }
  }
}

tag

Returns a tag from a provided tag ID or slug. Tags with isVisible set to false are excluded by default.

slugOrId:
string

Slug or ID of Tag

shopId:
string

The shop to which this tag belongs

shouldIncludeInvisible:
boolean

Set to true if you want to include tags that have isVisible set to false

Example

Request Content-Types: application/json
Query
query tag($slugOrId: String!, $shopId: ID!, $shouldIncludeInvisible: Boolean){
  tag(slugOrId: $slugOrId, shopId: $shopId, shouldIncludeInvisible: $shouldIncludeInvisible){
    _id
    createdAt
    displayTitle
    featuredProductIds
    heroMediaUrl
    isDeleted
    isTopLevel
    isVisible
    metafields{
      description
      key
      namespace
      scope
      value
      valueType
    }
    name
    position
    slug
    subTagIds
    updatedAt
  }
}
Variables
{
  "slugOrId": "string",
  "shopId": "string",
  "shouldIncludeInvisible": "boolean"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "tag": {
      "_id": "string",
      "displayTitle": "string",
      "featuredProductIds": [
        "string"
      ],
      "heroMediaUrl": "string",
      "isDeleted": "boolean",
      "isTopLevel": "boolean",
      "isVisible": "boolean",
      "metafields": [
        {
          "description": "string",
          "key": "string",
          "namespace": "string",
          "scope": "string",
          "value": "string",
          "valueType": "string"
        }
      ],
      "name": "string",
      "position": "integer",
      "slug": "string",
      "subTagIds": [
        "string"
      ]
    }
  }
}

tags

Returns a paged list of tags for a shop. You must include a shopId when querying.

shopId:
string

Only tags associated with this shop will be returned

filter:
string

If provided, this query will do a regex search using the provided filter data, and return only tags that match

excludedTagIds:
string[]

Tags to exclude from results

isTopLevel:
boolean

If set, the query will return only top-level tags or only non-top-level tags. By default, both types of tags are returned.

shouldIncludeDeleted:
boolean

Set to true if you want soft deleted tags to be included in the response

shouldIncludeInvisible:
boolean

Set to true if you want to include tags that have isVisible set to false

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

sortOrder:

Return results sorted in this order

By default, tags are sorted by position. Set this to sort by one of the other allowed fields

Example

Request Content-Types: application/json
Query
query tags($shopId: ID!, $filter: String, $excludedTagIds: [ID], $isTopLevel: Boolean, $shouldIncludeDeleted: Boolean, $shouldIncludeInvisible: Boolean, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $sortOrder: SortOrder, $sortBy: TagSortByField){
  tags(shopId: $shopId, filter: $filter, excludedTagIds: $excludedTagIds, isTopLevel: $isTopLevel, shouldIncludeDeleted: $shouldIncludeDeleted, shouldIncludeInvisible: $shouldIncludeInvisible, after: $after, before: $before, first: $first, last: $last, sortOrder: $sortOrder, sortBy: $sortBy){
    edges{
      cursor
      node{
        _id
        createdAt
        displayTitle
        featuredProductIds
        heroMediaUrl
        isDeleted
        isTopLevel
        isVisible
        metafields{
          description
          key
          namespace
          scope
          value
          valueType
        }
        name
        position
        slug
        subTagIds
        updatedAt
      }
    }
    nodes{
      _id
      createdAt
      displayTitle
      featuredProductIds
      heroMediaUrl
      isDeleted
      isTopLevel
      isVisible
      metafields{
        ...RecursiveMetafieldFragment
      }
      name
      position
      slug
      subTagIds
      updatedAt
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "filter": "string",
  "excludedTagIds": [
    "string"
  ],
  "isTopLevel": "boolean",
  "shouldIncludeDeleted": "boolean",
  "shouldIncludeInvisible": "boolean",
  "sortOrder": "string",
  "sortBy": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "tags": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "displayTitle": "string",
            "featuredProductIds": [
              "string"
            ],
            "heroMediaUrl": "string",
            "isDeleted": "boolean",
            "isTopLevel": "boolean",
            "isVisible": "boolean",
            "metafields": [
              {
                "description": "string",
                "key": "string",
                "namespace": "string",
                "scope": "string",
                "value": "string",
                "valueType": "string"
              }
            ],
            "name": "string",
            "position": "integer",
            "slug": "string",
            "subTagIds": [
              "string"
            ]
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "displayTitle": "string",
          "featuredProductIds": [
            "string"
          ],
          "heroMediaUrl": "string",
          "isDeleted": "boolean",
          "isTopLevel": "boolean",
          "isVisible": "boolean",
          "metafields": [
            {
              "description": "string",
              "key": "string",
              "namespace": "string",
              "scope": "string",
              "value": "string",
              "valueType": "string"
            }
          ],
          "name": "string",
          "position": "integer",
          "slug": "string",
          "subTagIds": [
            "string"
          ]
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

taxCodes

List all tax codes supported by the current active tax service for the shop

shopId:
string

The shop to use for getting the list of active tax services

Example

Request Content-Types: application/json
Query
query taxCodes($shopId: ID!){
  taxCodes(shopId: $shopId)
}
Variables
{
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "taxCodes": [
      {
        "code": "string",
        "label": "string"
      }
    ]
  }
}

taxRates

Gets tax rates

shopId:
string

Provide a shp ID from which you want to get tax rates

after:
object

Return only results that come after this cursor. Use this with first to specify the number of results to return.

before:
object

Return only results that come before this cursor. Use this with last to specify the number of results to return.

first:
object

Return at most this many results. This parameter may be used with either after or offset parameters.

last:
object

Return at most this many results. This parameter may be used with the before parameter.

offset:
integer

Return only results that come after the Nth result. This parameter may be used with the first parameter.

Example

Request Content-Types: application/json
Query
query taxRates($shopId: ID!, $after: ConnectionCursor, $before: ConnectionCursor, $first: ConnectionLimitInt, $last: ConnectionLimitInt, $offset: Int){
  taxRates(shopId: $shopId, after: $after, before: $before, first: $first, last: $last, offset: $offset){
    edges{
      cursor
      node{
        _id
        country
        postal
        rate
        region
        sourcing
        taxCode
      }
    }
    nodes{
      _id
      country
      postal
      rate
      region
      sourcing
      taxCode
    }
    pageInfo{
      endCursor
      hasNextPage
      hasPreviousPage
      startCursor
    }
    totalCount
  }
}
Variables
{
  "shopId": "string",
  "offset": "integer"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "taxRates": {
      "edges": [
        {
          "node": {
            "_id": "string",
            "country": "string",
            "postal": "string",
            "rate": "number",
            "region": "string",
            "taxCode": "string"
          }
        }
      ],
      "nodes": [
        {
          "_id": "string",
          "country": "string",
          "postal": "string",
          "rate": "number",
          "region": "string",
          "taxCode": "string"
        }
      ],
      "pageInfo": {
        "hasNextPage": "boolean",
        "hasPreviousPage": "boolean"
      },
      "totalCount": "integer"
    }
  }
}

taxServices

Get a full list of all tax services for the shop

shopId:
string

The shop to use for getting the list of all tax services

Example

Request Content-Types: application/json
Query
query taxServices($shopId: ID!){
  taxServices(shopId: $shopId)
}
Variables
{
  "shopId": "string"
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "taxServices": [
      {
        "displayName": "string",
        "name": "string",
        "pluginName": "string"
      }
    ]
  }
}

viewer

Returns the account for the authenticated user

Example

Request Content-Types: application/json
Query
query viewer{
  viewer{
    _id
    bio
    createdAt
    firstName
    language
    lastName
    metafields{
      description
      key
      namespace
      scope
      value
      valueType
    }
    name
    note
    picture
    preferences
    primaryEmailAddress
    updatedAt
    userId
    username
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "viewer": {
      "_id": "string",
      "bio": "string",
      "firstName": "string",
      "language": "string",
      "lastName": "string",
      "metafields": [
        {
          "description": "string",
          "key": "string",
          "namespace": "string",
          "scope": "string",
          "value": "string",
          "valueType": "string"
        }
      ],
      "name": "string",
      "note": "string",
      "picture": "string",
      "userId": "string",
      "username": "string"
    }
  }
}

Mutations

Mutations have side effects, such as mutating data or triggering a task

addAccountAddressBookEntry

Add a new address to the addressBook field for an account

Mutation input

Example

Request Content-Types: application/json
Query
mutation addAccountAddressBookEntry($input: AddAccountAddressBookEntryInput!){
  addAccountAddressBookEntry(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "accountId": "object",
    "address": {
      "address1": "string",
      "address2": "string",
      "addressName": "string",
      "city": "string",
      "company": "string",
      "country": "string",
      "firstName": "string",
      "fullName": "string",
      "isBillingDefault": "boolean",
      "isCommercial": "boolean",
      "isShippingDefault": "boolean",
      "lastName": "string",
      "metafields": [
        {
          "description": "string",
          "key": "string",
          "namespace": "string",
          "scope": "string",
          "value": "string",
          "valueType": "string"
        }
      ],
      "phone": "string",
      "postal": "string",
      "region": "string"
    },
    "clientMutationId": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addAccountAddressBookEntry": {
      "clientMutationId": "string"
    }
  }
}

addAccountEmailRecord

Add an email address to an account

Mutation input

Example

Request Content-Types: application/json
Query
mutation addAccountEmailRecord($input: AddAccountEmailRecordInput!){
  addAccountEmailRecord(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "accountId": "object",
    "clientMutationId": "string",
    "email": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addAccountEmailRecord": {
      "clientMutationId": "string"
    }
  }
}

addAccountToGroup

Add an account to a group

Mutation input

Example

Request Content-Types: application/json
Query
mutation addAccountToGroup($input: AddAccountToGroupInput!){
  addAccountToGroup(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "accountId": "object",
    "clientMutationId": "string",
    "groupId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addAccountToGroup": {
      "clientMutationId": "string"
    }
  }
}

addCartItems

Add item(s) to a cart

Mutation input

Example

Request Content-Types: application/json
Query
mutation addCartItems($input: AddCartItemsInput!){
  addCartItems(input: $input){
    clientMutationId
    incorrectPriceFailures
    minOrderQuantityFailures
  }
}
Variables
{
  "input": {
    "cartId": "object",
    "cartToken": "string",
    "clientMutationId": "string",
    "items": [
      {
        "metafields": [
          {
            "description": "string",
            "key": "string",
            "namespace": "string",
            "scope": "string",
            "value": "string",
            "valueType": "string"
          }
        ],
        "price": {
          "amount": "number",
          "currencyCode": "string"
        },
        "productConfiguration": {
          "productId": "object",
          "productVariantId": "object"
        },
        "quantity": "integer"
      }
    ]
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addCartItems": {
      "clientMutationId": "string"
    }
  }
}

addOrderFulfillmentGroup

Use this mutation to add a new order fulfillment group to an order. It must have at least one item. Items may be provided or moved from another existing group or both.

Mutation input

Example

Request Content-Types: application/json
Query
mutation addOrderFulfillmentGroup($input: AddOrderFulfillmentGroupInput!){
  addOrderFulfillmentGroup(input: $input){
    clientMutationId
    newFulfillmentGroupId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "fulfillmentGroup": {
      "data": {
        "shippingAddress": {
          "address1": "string",
          "address2": "string",
          "addressName": "string",
          "city": "string",
          "company": "string",
          "country": "string",
          "firstName": "string",
          "fullName": "string",
          "isBillingDefault": "boolean",
          "isCommercial": "boolean",
          "isShippingDefault": "boolean",
          "lastName": "string",
          "metafields": [
            {
              "description": "string",
              "key": "string",
              "namespace": "string",
              "scope": "string",
              "value": "string",
              "valueType": "string"
            }
          ],
          "phone": "string",
          "postal": "string",
          "region": "string"
        }
      },
      "items": [
        {
          "addedAt": "object",
          "price": "number",
          "productConfiguration": {
            "productId": "object",
            "productVariantId": "object"
          },
          "quantity": "integer"
        }
      ],
      "selectedFulfillmentMethodId": "object",
      "shopId": "object",
      "totalPrice": "number",
      "type": "string"
    },
    "moveItemIds": [
      "object"
    ],
    "orderId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addOrderFulfillmentGroup": {
      "clientMutationId": "string",
      "newFulfillmentGroupId": "string"
    }
  }
}

addTag

Adds a new tag

input:

Mutation input

Example

Request Content-Types: application/json
Query
mutation addTag($input: AddTagInput!){
  addTag(input: $input){
    clientMutationId
    shopId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "displayTitle": "string",
    "heroMediaUrl": "string",
    "isVisible": "boolean",
    "metafields": [
      {
        "description": "string",
        "key": "string",
        "namespace": "string",
        "scope": "string",
        "value": "string",
        "valueType": "string"
      }
    ],
    "name": "string",
    "shopId": "object",
    "slug": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addTag": {
      "clientMutationId": "string",
      "shopId": "string"
    }
  }
}

addTagsToProducts

Bulk operation for adding an array of tags to an array of products

input which must includes an array of product ids and an array of tag ids

Example

Request Content-Types: application/json
Query
mutation addTagsToProducts($input: ProductTagsOperationInput!){
  addTagsToProducts(input: $input){
    clientMutationId
    foundCount
    notFoundCount
    updatedCount
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "productIds": [
      "object"
    ],
    "shopId": "object",
    "tagIds": [
      "object"
    ]
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "addTagsToProducts": {
      "clientMutationId": "string",
      "foundCount": "integer",
      "notFoundCount": "integer",
      "updatedCount": "integer"
    }
  }
}

applyDiscountCodeToCart

Apply a discount code to a cart

Mutation input

Example

Request Content-Types: application/json
Query
mutation applyDiscountCodeToCart($input: ApplyDiscountCodeToCartInput!){
  applyDiscountCodeToCart(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "cartId": "object",
    "discountCode": "string",
    "shopId": "object",
    "token": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "applyDiscountCodeToCart": {
      "clientMutationId": "string"
    }
  }
}

approveOrderPayments

Approve one or more payments for an order

Mutation input

Example

Request Content-Types: application/json
Query
mutation approveOrderPayments($input: ApproveOrderPaymentsInput!){
  approveOrderPayments(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "orderId": "object",
    "paymentIds": [
      "object"
    ],
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "approveOrderPayments": {
      "clientMutationId": "string"
    }
  }
}

archiveMediaRecord

Archive a MediaRecord to hide it without deleting the backing file data

Mutation input

Example

Request Content-Types: application/json
Query
mutation archiveMediaRecord($input: ArchiveMediaRecordInput!){
  archiveMediaRecord(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "mediaRecordId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "archiveMediaRecord": {
      "clientMutationId": "string"
    }
  }
}

archiveProducts

Archive products

Mutation input

Example

Request Content-Types: application/json
Query
mutation archiveProducts($input: ArchiveProductsInput!){
  archiveProducts(input: $input){
    clientMutationId
    products
  }
}
Variables
{
  "input": {
    "productIds": [
      "object"
    ],
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "archiveProducts": {
      "clientMutationId": "string"
    }
  }
}

archiveProductVariants

Archive product variants

Mutation input

Example

Request Content-Types: application/json
Query
mutation archiveProductVariants($input: ArchiveProductVariantsInput!){
  archiveProductVariants(input: $input){
    clientMutationId
    variants
  }
}
Variables
{
  "input": {
    "shopId": "object",
    "variantIds": [
      "object"
    ]
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "archiveProductVariants": {
      "clientMutationId": "string"
    }
  }
}

cancelOrderItem

Use this mutation to cancel one item of an order, either for the full ordered quantity or for a partial quantity. If partial, the item will be split into two items and the original item will have a lower quantity and will be canceled.

If this results in all items in a fulfillment group being canceled, the group will also be canceled. If this results in all fulfillment groups being canceled, the full order will also be canceled.

Mutation input

Example

Request Content-Types: application/json
Query
mutation cancelOrderItem($input: CancelOrderItemInput!){
  cancelOrderItem(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "cancelQuantity": "integer",
    "clientMutationId": "string",
    "itemId": "object",
    "orderId": "object",
    "reason": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "cancelOrderItem": {
      "clientMutationId": "string"
    }
  }
}

captureOrderPayments

Capture one or more payments for an order

Mutation input

Example

Request Content-Types: application/json
Query
mutation captureOrderPayments($input: CaptureOrderPaymentsInput!){
  captureOrderPayments(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "orderId": "object",
    "paymentIds": [
      "object"
    ],
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "captureOrderPayments": {
      "clientMutationId": "string"
    }
  }
}

cloneProducts

Clone an existing product

Mutation input

Example

Request Content-Types: application/json
Query
mutation cloneProducts($input: CloneProductsInput!){
  cloneProducts(input: $input){
    clientMutationId
    products
  }
}
Variables
{
  "input": {
    "productIds": [
      "object"
    ],
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "cloneProducts": {
      "clientMutationId": "string"
    }
  }
}

cloneProductVariants

Clone an existing product variant

Mutation input

Example

Request Content-Types: application/json
Query
mutation cloneProductVariants($input: CloneProductVariantsInput!){
  cloneProductVariants(input: $input){
    clientMutationId
    variants
  }
}
Variables
{
  "input": {
    "shopId": "object",
    "variantIds": [
      "object"
    ]
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "cloneProductVariants": {
      "clientMutationId": "string"
    }
  }
}

createAccount

Create an account based off a user

Mutation input

Example

Request Content-Types: application/json
Query
mutation createAccount($input: CreateAccountInput!){
  createAccount(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "bio": "string",
    "emails": [
      {
        "address": "object",
        "provides": "string",
        "verified": "boolean"
      }
    ],
    "name": "string",
    "picture": "string",
    "shopId": "object",
    "userId": "object",
    "username": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createAccount": {
      "clientMutationId": "string"
    }
  }
}

createAccountGroup

Create a new account group. These are usually used for account group permissions

Mutation input

Example

Request Content-Types: application/json
Query
mutation createAccountGroup($input: CreateAccountGroupInput!){
  createAccountGroup(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "group": {
      "description": "string",
      "name": "string",
      "permissions": [
        "string"
      ],
      "slug": "string"
    },
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createAccountGroup": {
      "clientMutationId": "string"
    }
  }
}

createAddressValidationRule

Create an address validation rule

Mutation input

Example

Request Content-Types: application/json
Query
mutation createAddressValidationRule($input: CreateAddressValidationRuleInput!){
  createAddressValidationRule(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "countryCodes": [
      "string"
    ],
    "serviceName": "string",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createAddressValidationRule": {
      "clientMutationId": "string"
    }
  }
}

createCart

Create a new cart

Mutation input

Example

Request Content-Types: application/json
Query
mutation createCart($input: CreateCartInput!){
  createCart(input: $input){
    clientMutationId
    incorrectPriceFailures
    minOrderQuantityFailures
    token
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "items": [
      {
        "metafields": [
          {
            "description": "string",
            "key": "string",
            "namespace": "string",
            "scope": "string",
            "value": "string",
            "valueType": "string"
          }
        ],
        "price": {
          "amount": "number",
          "currencyCode": "string"
        },
        "productConfiguration": {
          "productId": "object",
          "productVariantId": "object"
        },
        "quantity": "integer"
      }
    ],
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createCart": {
      "clientMutationId": "string",
      "token": "string"
    }
  }
}

createDiscountCode

Create a new discount code

Mutation input

Example

Request Content-Types: application/json
Query
mutation createDiscountCode($input: CreateDiscountCodeInput!){
  createDiscountCode(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "discountCode": {
      "calculation": {
        "method": "string"
      },
      "code": "string",
      "conditions": {
        "accountLimit": "integer",
        "audience": [
          "string"
        ],
        "enabled": "boolean",
        "order": {
          "endDate": "object",
          "max": "number",
          "min": "number",
          "startDate": "object"
        },
        "permissions": [
          "string"
        ],
        "products": [
          "string"
        ],
        "redemptionLimit": "integer",
        "tags": [
          "string"
        ]
      },
      "description": "string",
      "discount": "string",
      "discountMethod": "string",
      "label": "string",
      "transactions": [
        {
          "appliedAt": "object",
          "cartId": "string",
          "userId": "string"
        }
      ]
    },
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createDiscountCode": {
      "clientMutationId": "string"
    }
  }
}

createFlatRateFulfillmentMethod

Create a flat rate fulfillment method

Mutation input

Example

Request Content-Types: application/json
Query
mutation createFlatRateFulfillmentMethod($input: CreateFlatRateFulfillmentMethodInput!){
  createFlatRateFulfillmentMethod(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "method": {
      "cost": "number",
      "fulfillmentTypes": [
        "string"
      ],
      "group": "string",
      "handling": "number",
      "isEnabled": "boolean",
      "label": "string",
      "name": "string",
      "rate": "number"
    },
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createFlatRateFulfillmentMethod": {
      "clientMutationId": "string"
    }
  }
}

createFlatRateFulfillmentRestriction

Create a flat rate fulfillment method restriction.

Example

Request Content-Types: application/json
Query
mutation createFlatRateFulfillmentRestriction($input: CreateFlatRateFulfillmentRestrictionInput!){
  createFlatRateFulfillmentRestriction(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "restriction": {
      "attributes": [
        {
          "operator": "string",
          "property": "string",
          "propertyType": "string",
          "value": "string"
        }
      ],
      "destination": {
        "country": [
          "string"
        ],
        "postal": [
          "string"
        ],
        "region": [
          "string"
        ]
      },
      "methodIds": [
        "object"
      ],
      "type": "string"
    },
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createFlatRateFulfillmentRestriction": {
      "clientMutationId": "string"
    }
  }
}

createMediaRecord

Create the MediaRecord for file data after you upload it

Mutation input

Example

Request Content-Types: application/json
Query
mutation createMediaRecord($input: CreateMediaRecordInput!){
  createMediaRecord(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "mediaRecord": {
      "metadata": {
        "priority": "integer",
        "productId": "object",
        "type": "string",
        "variantId": "object"
      },
      "original": {
        "name": "string",
        "size": "integer",
        "tempStoreId": "string",
        "type": "string",
        "updatedAt": "object",
        "uploadedAt": "object"
      }
    },
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createMediaRecord": {
      "clientMutationId": "string"
    }
  }
}

createNavigationItem

Create a new navigation item

Mutation input

Example

Request Content-Types: application/json
Query
mutation createNavigationItem($input: CreateNavigationItemInput!){
  createNavigationItem(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "navigationItem": {
      "draftData": {
        "classNames": "string",
        "content": [
          {
            "language": "string",
            "value": "string"
          }
        ],
        "isUrlRelative": "boolean",
        "shouldOpenInNewWindow": "boolean",
        "url": "string"
      },
      "metadata": "object",
      "shopId": "object"
    }
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createNavigationItem": {
      "clientMutationId": "string"
    }
  }
}

createNavigationTree

Create a new navigation tree

Mutation input

Example

Request Content-Types: application/json
Query
mutation createNavigationTree($input: CreateNavigationTreeInput!){
  createNavigationTree(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "draftItems": [
      {
        "expanded": "boolean",
        "isPrivate": "boolean",
        "isSecondary": "boolean",
        "isVisible": "boolean",
        "items": [
          {
            "expanded": "boolean",
            "isPrivate": "boolean",
            "isSecondary": "boolean",
            "isVisible": "boolean",
            "items": [
              {
                "expanded": "boolean",
                "isPrivate": "boolean",
                "isSecondary": "boolean",
                "isVisible": "boolean",
                "items": [
                  {
                    "expanded": "boolean",
                    "isPrivate": "boolean",
                    "isSecondary": "boolean",
                    "isVisible": "boolean",
                    "items": [
                      {
                        "expanded": "boolean",
                        "isPrivate": "boolean",
                        "isSecondary": "boolean",
                        "isVisible": "boolean",
                        "items": [
                          {
                            "expanded": "boolean",
                            "isPrivate": "boolean",
                            "isSecondary": "boolean",
                            "isVisible": "boolean",
                            "items": [
                              {
                                "expanded": "boolean",
                                "isPrivate": "boolean",
                                "isSecondary": "boolean",
                                "isVisible": "boolean",
                                "items": [
                                  {
                                    "expanded": "boolean",
                                    "isPrivate": "boolean",
                                    "isSecondary": "boolean",
                                    "isVisible": "boolean",
                                    "items": [
                                      {
                                        "expanded": "boolean",
                                        "isPrivate": "boolean"
                                      }
                                    ]
                                  }
                                ]
                              }
                            ]
                          }
                        ]
                      }
                    ]
                  }
                ]
              }
            ]
          }
        ]
      }
    ]
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createNavigationTree": {
      "clientMutationId": "string"
    }
  }
}

createProduct

Create a new product

Mutation input

Example

Request Content-Types: application/json
Query
mutation createProduct($input: CreateProductInput!){
  createProduct(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createProduct": {
      "clientMutationId": "string"
    }
  }
}

createProductVariant

Create a new product variant

Mutation input

Example

Request Content-Types: application/json
Query
mutation createProductVariant($input: CreateProductVariantInput!){
  createProductVariant(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "productId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createProductVariant": {
      "clientMutationId": "string"
    }
  }
}

createRefund

Use this mutation to create a refund on a payment method used to make the order

Mutation input

Example

Request Content-Types: application/json
Query
mutation createRefund($input: CreateRefundInput!){
  createRefund(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "amount": "number",
    "orderId": "object",
    "paymentId": "object",
    "reason": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createRefund": {
      "clientMutationId": "string"
    }
  }
}

createShop

Create a new shop

Mutation input

Example

Request Content-Types: application/json
Query
mutation createShop($input: CreateShopInput!){
  createShop(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "currencyCode": "string",
    "defaultLanguage": "string",
    "defaultTimezone": "string",
    "description": "string",
    "name": "string",
    "type": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createShop": {
      "clientMutationId": "string"
    }
  }
}

createSurcharge

Create a surcharge

Mutation input

Example

Request Content-Types: application/json
Query
mutation createSurcharge($input: CreateSurchargeInput!){
  createSurcharge(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "shopId": "object",
    "surcharge": {
      "amount": "number",
      "attributes": [
        {
          "operator": "string",
          "property": "string",
          "propertyType": "string",
          "value": "string"
        }
      ],
      "destination": {
        "country": [
          "string"
        ],
        "postal": [
          "string"
        ],
        "region": [
          "string"
        ]
      },
      "messagesByLanguage": [
        {
          "content": "string",
          "language": "string"
        }
      ],
      "methodIds": [
        "object"
      ],
      "type": "string"
    }
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createSurcharge": {
      "clientMutationId": "string"
    }
  }
}

createTaxRate

Create a new tax rate

Mutation input

Example

Request Content-Types: application/json
Query
mutation createTaxRate($input: CreateTaxRateInput!){
  createTaxRate(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "country": "string",
    "postal": "string",
    "rate": "number",
    "region": "string",
    "shopId": "object",
    "sourcing": "string",
    "taxCode": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "createTaxRate": {
      "clientMutationId": "string"
    }
  }
}

deleteAddressValidationRule

Delete an address validation rule

Mutation input

Example

Request Content-Types: application/json
Query
mutation deleteAddressValidationRule($input: DeleteAddressValidationRuleInput!){
  deleteAddressValidationRule(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "ruleId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "deleteAddressValidationRule": {
      "clientMutationId": "string"
    }
  }
}

deleteDiscountCode

Delete a discount code

Mutation input

Example

Request Content-Types: application/json
Query
mutation deleteDiscountCode($input: DeleteDiscountCodeInput!){
  deleteDiscountCode(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "discountCodeId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "deleteDiscountCode": {
      "clientMutationId": "string"
    }
  }
}

deleteFlatRateFulfillmentMethod

Delete a flat rate fulfillment method

Mutation input

Example

Request Content-Types: application/json
Query
mutation deleteFlatRateFulfillmentMethod($input: DeleteFlatRateFulfillmentMethodInput!){
  deleteFlatRateFulfillmentMethod(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "methodId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "deleteFlatRateFulfillmentMethod": {
      "clientMutationId": "string"
    }
  }
}

deleteFlatRateFulfillmentRestriction

Delete a flat rate fulfillment method restriction

Example

Request Content-Types: application/json
Query
mutation deleteFlatRateFulfillmentRestriction($input: DeleteFlatRateFulfillmentRestrictionInput!){
  deleteFlatRateFulfillmentRestriction(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "restrictionId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "deleteFlatRateFulfillmentRestriction": {
      "clientMutationId": "string"
    }
  }
}

deleteMediaRecord

Delete a MediaRecord to delete both the record and the backing file data

Mutation input

Example

Request Content-Types: application/json
Query
mutation deleteMediaRecord($input: DeleteMediaRecordInput!){
  deleteMediaRecord(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "mediaRecordId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "deleteMediaRecord": {
      "clientMutationId": "string"
    }
  }
}

deleteNavigationItem

Delete a navigation item

Mutation input

Example

Request Content-Types: application/json
Query
mutation deleteNavigationItem($input: DeleteNavigationItemInput!){
  deleteNavigationItem(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "id": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "deleteNavigationItem": {
      "clientMutationId": "string"
    }
  }
}

deleteSurcharge

Delete a flat rate fulfillment restriction

Mutation input

Example

Request Content-Types: application/json
Query
mutation deleteSurcharge($input: DeleteSurchargeInput!){
  deleteSurcharge(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "shopId": "object",
    "surchargeId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "deleteSurcharge": {
      "clientMutationId": "string"
    }
  }
}

deleteTaxRate

Delete a tax rate

Mutation input

Example

Request Content-Types: application/json
Query
mutation deleteTaxRate($input: DeleteTaxRateInput!){
  deleteTaxRate(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "shopId": "object",
    "taxRateId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "deleteTaxRate": {
      "clientMutationId": "string"
    }
  }
}

echo

A test mutation that returns whatever string you send it

str:
string

Any string

Example

Request Content-Types: application/json
Query
mutation echo($str: String){
  echo(str: $str)
}
Variables
{
  "str": "string"
}
Try it now
200 OK

Successful operation

type
string
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "echo": "string"
  }
}

enablePaymentMethodForShop

Enable a payment method for a shop

Mutation input

Example

Request Content-Types: application/json
Query
mutation enablePaymentMethodForShop($input: EnablePaymentMethodForShopInput!){
  enablePaymentMethodForShop(input: $input){
    clientMutationId
    paymentMethods
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "isEnabled": "boolean",
    "paymentMethodName": "string",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "enablePaymentMethodForShop": {
      "clientMutationId": "string"
    }
  }
}

generateSitemaps

Generate sitemap documents

Mutation input

Example

Request Content-Types: application/json
Query
mutation generateSitemaps($input: GenerateSitemapsInput){
  generateSitemaps(input: $input){
    clientMutationId
    wasJobScheduled
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "generateSitemaps": {
      "clientMutationId": "string",
      "wasJobScheduled": "boolean"
    }
  }
}

inviteShopMember

Given a person's email address and name, invite them to create an account for a certain shop, and put them in the provided permission group

Mutation input

Example

Request Content-Types: application/json
Query
mutation inviteShopMember($input: InviteShopMemberInput!){
  inviteShopMember(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "email": "string",
    "groupId": "object",
    "name": "string",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "inviteShopMember": {
      "clientMutationId": "string"
    }
  }
}

moveOrderItems

Use this mutation to move one or more items between existing order fulfillment groups.

Mutation input

Example

Request Content-Types: application/json
Query
mutation moveOrderItems($input: MoveOrderItemsInput!){
  moveOrderItems(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "fromFulfillmentGroupId": "object",
    "itemIds": [
      "object"
    ],
    "orderId": "object",
    "toFulfillmentGroupId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "moveOrderItems": {
      "clientMutationId": "string"
    }
  }
}

placeOrder

Use this mutation to place an order, providing information necessary to pay for it. The order will be placed only if authorization is successful for all submitted payments.

Mutation input

Example

Request Content-Types: application/json
Query
mutation placeOrder($input: PlaceOrderInput!){
  placeOrder(input: $input){
    clientMutationId
    orders
    token
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "order": {
      "cartId": "string",
      "currencyCode": "string",
      "email": "string",
      "fulfillmentGroups": [
        {
          "data": {
            "shippingAddress": {
              "address1": "string",
              "address2": "string",
              "addressName": "string",
              "city": "string",
              "company": "string",
              "country": "string",
              "firstName": "string",
              "fullName": "string",
              "isBillingDefault": "boolean",
              "isCommercial": "boolean",
              "isShippingDefault": "boolean",
              "lastName": "string",
              "metafields": [
                {
                  "description": "string",
                  "key": "string",
                  "namespace": "string",
                  "scope": "string",
                  "value": "string",
                  "valueType": "string"
                }
              ],
              "phone": "string",
              "postal": "string",
              "region": "string"
            }
          },
          "items": [
            {
              "addedAt": "object",
              "price": "number",
              "productConfiguration": {
                "productId": "object",
                "productVariantId": "object"
              },
              "quantity": "integer"
            }
          ],
          "selectedFulfillmentMethodId": "object",
          "shopId": "object",
          "totalPrice": "number",
          "type": "string"
        }
      ],
      "shopId": "string"
    },
    "payments": [
      {
        "amount": "number",
        "billingAddress": {
          "address1": "string"
        }
      }
    ]
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "placeOrder": {
      "clientMutationId": "string",
      "token": "string"
    }
  }
}

publishNavigationChanges

Publish the draft structure for a navigation tree and the draft changes for all of its navigation items. Sets hasUnpublishedChanges to false on tree and its items

Mutation input

Example

Request Content-Types: application/json
Query
mutation publishNavigationChanges($input: PublishNavigationChangesInput!){
  publishNavigationChanges(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "id": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "publishNavigationChanges": {
      "clientMutationId": "string"
    }
  }
}

publishProductsToCatalog

Publish products to the Catalog collection by product ID

productIds:
string[]

Array of Product ID

Example

Request Content-Types: application/json
Query
mutation publishProductsToCatalog($productIds: [ID]!){
  publishProductsToCatalog(productIds: $productIds){
    _id
    createdAt
    updatedAt
  }
}
Variables
{
  "productIds": [
    "string"
  ]
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "publishProductsToCatalog": [
      {
        "_id": "string"
      }
    ]
  }
}

recalculateReservedSimpleInventory

Force recalculation of the system-managed inventoryReserved field based on current order statuses

Example

Request Content-Types: application/json
Query
mutation recalculateReservedSimpleInventory($input: RecalculateReservedSimpleInventoryInput!){
  recalculateReservedSimpleInventory(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "productConfiguration": {
      "productId": "object",
      "productVariantId": "object"
    },
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "recalculateReservedSimpleInventory": {
      "clientMutationId": "string"
    }
  }
}

reconcileCarts

Reconcile an anonymous cart with the current account cart for the same shop

Mutation input

Example

Request Content-Types: application/json
Query
mutation reconcileCarts($input: ReconcileCartsInput!){
  reconcileCarts(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "anonymousCartId": "object",
    "cartToken": "string",
    "clientMutationId": "string",
    "mode": "string",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "reconcileCarts": {
      "clientMutationId": "string"
    }
  }
}

removeAccountAddressBookEntry

Remove an address from the addressBook field for an account

Mutation input

Example

Request Content-Types: application/json
Query
mutation removeAccountAddressBookEntry($input: RemoveAccountAddressBookEntryInput!){
  removeAccountAddressBookEntry(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "accountId": "object",
    "addressId": "object",
    "clientMutationId": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "removeAccountAddressBookEntry": {
      "clientMutationId": "string"
    }
  }
}

removeAccountEmailRecord

Remove an email address from an account

Mutation input

Example

Request Content-Types: application/json
Query
mutation removeAccountEmailRecord($input: RemoveAccountEmailRecordInput!){
  removeAccountEmailRecord(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "accountId": "object",
    "clientMutationId": "string",
    "email": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "removeAccountEmailRecord": {
      "clientMutationId": "string"
    }
  }
}

removeAccountFromGroup

Remove an account from a group

Mutation input

Example

Request Content-Types: application/json
Query
mutation removeAccountFromGroup($input: RemoveAccountFromGroupInput!){
  removeAccountFromGroup(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "accountId": "object",
    "clientMutationId": "string",
    "groupId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "removeAccountFromGroup": {
      "clientMutationId": "string"
    }
  }
}

removeAccountGroup

Remove an existing permission group

Mutation input

Example

Request Content-Types: application/json
Query
mutation removeAccountGroup($input: RemoveAccountGroupInput!){
  removeAccountGroup(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "groupId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "removeAccountGroup": {
      "clientMutationId": "string"
    }
  }
}

removeCartItems

Remove item(s) from a cart

Mutation input

Example

Request Content-Types: application/json
Query
mutation removeCartItems($input: RemoveCartItemsInput!){
  removeCartItems(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "cartId": "object",
    "cartItemIds": [
      "object"
    ],
    "cartToken": "string",
    "clientMutationId": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "removeCartItems": {
      "clientMutationId": "string"
    }
  }
}

removeDiscountCodeFromCart

Remove a discount code from a cart

Mutation input

Example

Request Content-Types: application/json
Query
mutation removeDiscountCodeFromCart($input: RemoveDiscountCodeFromCartInput!){
  removeDiscountCodeFromCart(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "cartId": "object",
    "discountId": "object",
    "shopId": "object",
    "token": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "removeDiscountCodeFromCart": {
      "clientMutationId": "string"
    }
  }
}

removeTag

Removes an existing tag

Mutation input

Example

Request Content-Types: application/json
Query
mutation removeTag($input: RemoveTagInput!){
  removeTag(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "id": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "removeTag": {
      "clientMutationId": "string"
    }
  }
}

removeTagsFromProducts

Bulk operation for removing an array of tags from an array of products

input which must includes an array of product ids and an array of tag ids

Example

Request Content-Types: application/json
Query
mutation removeTagsFromProducts($input: ProductTagsOperationInput!){
  removeTagsFromProducts(input: $input){
    clientMutationId
    foundCount
    notFoundCount
    updatedCount
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "productIds": [
      "object"
    ],
    "shopId": "object",
    "tagIds": [
      "object"
    ]
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "removeTagsFromProducts": {
      "clientMutationId": "string",
      "foundCount": "integer",
      "notFoundCount": "integer",
      "updatedCount": "integer"
    }
  }
}

retryFailedEmail

Retry a failed or cancelled email job

Mutation input

Example

Request Content-Types: application/json
Query
mutation retryFailedEmail($input: RetryFailedEmailInput!){
  retryFailedEmail(input: $input){
    clientMutationId
    emailSent
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "jobId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "retryFailedEmail": {
      "clientMutationId": "string",
      "emailSent": "boolean"
    }
  }
}

selectFulfillmentOptionForGroup

Select a fulfillment option from the availableFulfillmentOptions list for a fulfillment group

Mutation input

Example

Request Content-Types: application/json
Query
mutation selectFulfillmentOptionForGroup($input: SelectFulfillmentOptionForGroupInput!){
  selectFulfillmentOptionForGroup(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "cartId": "object",
    "cartToken": "string",
    "clientMutationId": "string",
    "fulfillmentGroupId": "object",
    "fulfillmentMethodId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "selectFulfillmentOptionForGroup": {
      "clientMutationId": "string"
    }
  }
}

sendResetAccountPasswordEmail

Send a reset password email to an email address from an account

Mutation input

Example

Request Content-Types: application/json
Query
mutation sendResetAccountPasswordEmail($input: SendResetAccountPasswordEmailInput!){
  sendResetAccountPasswordEmail(input: $input){
    clientMutationId
    email
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "email": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "sendResetAccountPasswordEmail": {
      "clientMutationId": "string",
      "email": "string"
    }
  }
}

setAccountDefaultEmail

Set default email address for an account

Mutation input

Example

Request Content-Types: application/json
Query
mutation setAccountDefaultEmail($input: SetAccountDefaultEmailInput!){
  setAccountDefaultEmail(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "accountId": "object",
    "clientMutationId": "string",
    "email": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "setAccountDefaultEmail": {
      "clientMutationId": "string"
    }
  }
}

setEmailOnAnonymousCart

Set the email address for an anonymous cart

Mutation input

Example

Request Content-Types: application/json
Query
mutation setEmailOnAnonymousCart($input: SetEmailOnAnonymousCartInput!){
  setEmailOnAnonymousCart(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "cartId": "object",
    "cartToken": "string",
    "clientMutationId": "string",
    "email": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "setEmailOnAnonymousCart": {
      "clientMutationId": "string"
    }
  }
}

setShippingAddressOnCart

Set the shipping address for all fulfillment groups

Mutation input

Example

Request Content-Types: application/json
Query
mutation setShippingAddressOnCart($input: SetShippingAddressOnCartInput!){
  setShippingAddressOnCart(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "address": {
      "address1": "string",
      "address2": "string",
      "addressName": "string",
      "city": "string",
      "company": "string",
      "country": "string",
      "firstName": "string",
      "fullName": "string",
      "isBillingDefault": "boolean",
      "isCommercial": "boolean",
      "isShippingDefault": "boolean",
      "lastName": "string",
      "metafields": [
        {
          "description": "string",
          "key": "string",
          "namespace": "string",
          "scope": "string",
          "value": "string",
          "valueType": "string"
        }
      ],
      "phone": "string",
      "postal": "string",
      "region": "string"
    },
    "addressId": "string",
    "cartId": "object",
    "cartToken": "string",
    "clientMutationId": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "setShippingAddressOnCart": {
      "clientMutationId": "string"
    }
  }
}

setTagHeroMedia

Add an image to the tag

Mutation input

Example

Request Content-Types: application/json
Query
mutation setTagHeroMedia($input: SetTagHeroMediaInput!){
  setTagHeroMedia(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "fileRecord": "object",
    "id": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "setTagHeroMedia": {
      "clientMutationId": "string"
    }
  }
}

splitOrderItem

Use this mutation to reduce the quantity of one item of an order and create a new item for the remaining quantity in the same fulfillment group, and with the same item status. You may want to do this if you are only able to partially fulfill the item order right now.

Mutation input

Example

Request Content-Types: application/json
Query
mutation splitOrderItem($input: SplitOrderItemInput!){
  splitOrderItem(input: $input){
    clientMutationId
    newItemId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "itemId": "object",
    "newItemQuantity": "integer",
    "orderId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "splitOrderItem": {
      "clientMutationId": "string",
      "newItemId": "string"
    }
  }
}

updateAccount

Update account fields

Mutation input

Example

Request Content-Types: application/json
Query
mutation updateAccount($input: UpdateAccountInput!){
  updateAccount(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "accountId": "object",
    "bio": "string",
    "clientMutationId": "string",
    "currencyCode": "string",
    "firstName": "string",
    "language": "string",
    "lastName": "string",
    "name": "string",
    "note": "string",
    "picture": "string",
    "username": "string"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "updateAccount": {
      "clientMutationId": "string"
    }
  }
}

updateAccountAddressBookEntry

Update an address that exists in the addressBook field for an account

Mutation input

Example

Request Content-Types: application/json
Query
mutation updateAccountAddressBookEntry($input: UpdateAccountAddressBookEntryInput!){
  updateAccountAddressBookEntry(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "accountId": "object",
    "addressId": "object",
    "clientMutationId": "string",
    "type": "string",
    "updates": {
      "address1": "string",
      "address2": "string",
      "addressName": "string",
      "city": "string",
      "company": "string",
      "country": "string",
      "firstName": "string",
      "fullName": "string",
      "isBillingDefault": "boolean",
      "isCommercial": "boolean",
      "isShippingDefault": "boolean",
      "lastName": "string",
      "metafields": [
        {
          "description": "string",
          "key": "string",
          "namespace": "string",
          "scope": "string",
          "value": "string",
          "valueType": "string"
        }
      ],
      "phone": "string",
      "postal": "string",
      "region": "string"
    }
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "updateAccountAddressBookEntry": {
      "clientMutationId": "string"
    }
  }
}

updateAccountGroup

Update an existing permission group

Mutation input

Example

Request Content-Types: application/json
Query
mutation updateAccountGroup($input: UpdateAccountGroupInput!){
  updateAccountGroup(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "group": {
      "description": "string",
      "name": "string",
      "permissions": [
        "string"
      ],
      "slug": "string"
    },
    "groupId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "updateAccountGroup": {
      "clientMutationId": "string"
    }
  }
}

updateAddressValidationRule

Update an address validation rule

Mutation input

Example

Request Content-Types: application/json
Query
mutation updateAddressValidationRule($input: UpdateAddressValidationRuleInput!){
  updateAddressValidationRule(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "countryCodes": [
      "string"
    ],
    "ruleId": "object",
    "serviceName": "string",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "updateAddressValidationRule": {
      "clientMutationId": "string"
    }
  }
}

updateCartItemsQuantity

Update cart item(s) quantity. Use absolute quantity. If updating to 0, the item will be removed.

Mutation input

Example

Request Content-Types: application/json
Query
mutation updateCartItemsQuantity($input: UpdateCartItemsQuantityInput!){
  updateCartItemsQuantity(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "cartId": "object",
    "cartToken": "string",
    "clientMutationId": "string",
    "items": [
      {
        "cartItemId": "object",
        "quantity": "integer"
      }
    ]
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "updateCartItemsQuantity": {
      "clientMutationId": "string"
    }
  }
}

updateDiscountCode

Update a discount code

Mutation input

Example

Request Content-Types: application/json
Query
mutation updateDiscountCode($input: UpdateDiscountCodeInput!){
  updateDiscountCode(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "discountCode": {
      "calculation": {
        "method": "string"
      },
      "code": "string",
      "conditions": {
        "accountLimit": "integer",
        "audience": [
          "string"
        ],
        "enabled": "boolean",
        "order": {
          "endDate": "object",
          "max": "number",
          "min": "number",
          "startDate": "object"
        },
        "permissions": [
          "string"
        ],
        "products": [
          "string"
        ],
        "redemptionLimit": "integer",
        "tags": [
          "string"
        ]
      },
      "description": "string",
      "discount": "string",
      "discountMethod": "string",
      "label": "string",
      "transactions": [
        {
          "appliedAt": "object",
          "cartId": "string",
          "userId": "string"
        }
      ]
    },
    "discountCodeId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "updateDiscountCode": {
      "clientMutationId": "string"
    }
  }
}

updateFlatRateFulfillmentMethod

Update a flat rate fulfillment method

Mutation input

Example

Request Content-Types: application/json
Query
mutation updateFlatRateFulfillmentMethod($input: UpdateFlatRateFulfillmentMethodInput!){
  updateFlatRateFulfillmentMethod(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "method": {
      "cost": "number",
      "fulfillmentTypes": [
        "string"
      ],
      "group": "string",
      "handling": "number",
      "isEnabled": "boolean",
      "label": "string",
      "name": "string",
      "rate": "number"
    },
    "methodId": "object",
    "shopId": "object"
  }
}
Try it now
Response Content-Types: application/json
Response Example (200 OK)
{
  "data": {
    "updateFlatRateFulfillmentMethod": {
      "clientMutationId": "string"
    }
  }
}

updateFlatRateFulfillmentRestriction

Update a flat rate fulfillment method restriction

Example

Request Content-Types: application/json
Query
mutation updateFlatRateFulfillmentRestriction($input: UpdateFlatRateFulfillmentRestrictionInput!){
  updateFlatRateFulfillmentRestriction(input: $input){
    clientMutationId
  }
}
Variables
{
  "input": {
    "clientMutationId": "string",
    "restriction": {
      "attributes": [
        {
          "operator": "string",
          "property": "string",
          "propertyType": "string",
          "value": "string"
        }
      ],
      "destination": {
        "country": [
          "string"
        ],
        "postal": [
          "string"
        ],
        "region": [
          "string"
        ]
      },
      "methodIds": [
        "object"
      ],
      "type": "string"
    },
    "restrictionId": "object",
    "shopId": "object"
  }
}
Try it now
200 OK

Successful operation

type