Mutations#

Mutations are write operations — use them to create, update, or delete resources. All mutations follow the same structure: a single input argument wraps all mutation fields, and the payload returns the affected resource.

mutation MutationName($input: MutationNameInput!) {
  mutationName(input: $input) {
    # fields to return
  }
}

Cart#

createCart#

Create a new empty cart.

No input required.

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation {
  createCart {
    cart {
      id
      number
      currency
      total {
        amount
        currency
        formatted
      }
    }
  }
}

addItemsToCart#

Add one or more items to a cart by SKU.

Input: AddItemsToCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
items
[CartItemInput!]!
RequiredItems to add

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation AddItemsToCart($input: AddItemsToCartInput!) {
  addItemsToCart(input: $input) {
    cart {
      id
      items {
        sku
        label
        quantity
        total
      }
      total
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "items": [
      { "sku": "BLK-HOODIE-M", "quantity": 2 }
    ]
  }
}

removeItemsFromCart#

Remove one or more items from a cart.

Input: RemoveItemsFromCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
items
[String!]!
RequiredIDs of cart items to remove

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation RemoveItemsFromCart($input: RemoveItemsFromCartInput!) {
  removeItemsFromCart(input: $input) {
    cart {
      id
      items {
        sku
        quantity
      }
      total
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "items": ["ci_5a6b7c8d-9e0f-1234-5678-9abcdef01234"]
  }
}

setItemQuantityForCart#

Update the quantity of a specific item in the cart.

Input: SetItemQuantityForCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
item_id
String!
RequiredThe ID of the cart item
quantity
Int!
RequiredNew quantity

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation SetItemQuantity($input: SetItemQuantityForCartInput!) {
  setItemQuantityForCart(input: $input) {
    cart {
      id
      items {
        sku
        quantity
        total
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "item_id": "ci_5a6b7c8d-9e0f-1234-5678-9abcdef01234",
    "quantity": 3
  }
}

addCustomerToCart#

Attach a customer (contact) to a cart.

Input: AddCustomerToCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
contact_id
String!
RequiredThe ID of the contact

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation AddCustomerToCart($input: AddCustomerToCartInput!) {
  addCustomerToCart(input: $input) {
    cart {
      id
      customer {
        contact {
          email
          given_name
          family_name
        }
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "contact_id": "con_a1b2c3d4-e5f6-7890-abcd-ef1234567890"
  }
}

addBillingAddressToCart#

Attach a billing address to a cart.

Input: AddBillingAddressToCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
address
AddressInput!
RequiredThe billing address

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation AddBillingAddress($input: AddBillingAddressToCartInput!) {
  addBillingAddressToCart(input: $input) {
    cart {
      id
      billing {
        address {
          address_line_1
          locality
          postal_code
          country_code
        }
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "address": {
      "address_line_1": "Keizersgracht 313",
      "locality": "Amsterdam",
      "postal_code": "1016 EE",
      "country_code": "NL"
    }
  }
}

addShippingAddressToCart#

Attach a shipping address to a cart. Uses the same AddressInput shape as addBillingAddressToCart.

Input: AddShippingAddressToCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
address
AddressInput!
RequiredThe shipping address

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation AddShippingAddress($input: AddShippingAddressToCartInput!) {
  addShippingAddressToCart(input: $input) {
    cart {
      id
      delivery {
        address {
          address_line_1
          locality
          country_code
        }
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "address": {
      "address_line_1": "Herengracht 401",
      "locality": "Amsterdam",
      "postal_code": "1017 BP",
      "country_code": "NL"
    }
  }
}

addShippingMethodToCart#

Select a shipping method for the cart. Available shipping methods can be fetched from cart.options.shipping_methods.

Input: AddShippingMethodToCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
shipping_method_id
String!
RequiredThe ID of the shipping method

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation AddShippingMethod($input: AddShippingMethodToCartInput!) {
  addShippingMethodToCart(input: $input) {
    cart {
      id
      delivery {
        method {
          id
          label
        }
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "shipping_method_id": "sm_e1f2a3b4-c5d6-7890-abcd-ef0123456789"
  }
}

addPaymentMethodToCart#

Select a payment method for the cart. Available payment methods can be fetched from cart.options.payment_methods.

Input: AddPaymentMethodToCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
payment_method_id
String!
RequiredThe ID of the payment method

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation AddPaymentMethod($input: AddPaymentMethodToCartInput!) {
  addPaymentMethodToCart(input: $input) {
    cart {
      id
      checkout {
        is_valid
        url
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "payment_method_id": "pm_e5f6a7b8-c9d0-1234-5678-90abcdef0123"
  }
}

addCouponToCart#

Apply a coupon code to the cart.

Input: AddCouponToCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
coupon
String!
RequiredThe coupon code

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation AddCoupon($input: AddCouponToCartInput!) {
  addCouponToCart(input: $input) {
    cart {
      id
      coupons {
        code
        discount
      }
      total
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "coupon": "SUMMER25"
  }
}

removeCouponFromCart#

Remove an applied coupon from the cart.

Input: RemoveCouponFromCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
coupon
String!
RequiredThe coupon code to remove

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation RemoveCoupon($input: RemoveCouponFromCartInput!) {
  removeCouponFromCart(input: $input) {
    cart {
      id
      coupons {
        code
      }
      total
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "coupon": "SUMMER25"
  }
}

setNoteForCart#

Add a customer note to the cart.

Input: SetNoteForCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
note
String!
RequiredThe note text

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation SetNote($input: SetNoteForCartInput!) {
  setNoteForCart(input: $input) {
    cart {
      id
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "note": "Please deliver between 9-12"
  }
}

setReferenceForCart#

Set an external reference on the cart (e.g. your own order reference).

Input: SetReferenceForCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
reference
String!
RequiredThe reference string

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation SetReference($input: SetReferenceForCartInput!) {
  setReferenceForCart(input: $input) {
    cart {
      id
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "reference": "PO-2024-0042"
  }
}

confirmCart#

Confirm a cart and convert it to an order. The cart must be valid (cart.checkout.is_valid must be true).

Input: ConfirmCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart to confirm

Returns: Order

NameTypeRequiredDescription
id
ID!
RequiredThe ID
number
String!
RequiredOrder number
total
Money!
RequiredTotal value
currency
Currency!
RequiredCurrency code

Example#

mutation ConfirmCart($input: ConfirmCartInput!) {
  confirmCart(input: $input) {
    order {
      id
      number
      total
      checkout {
        url
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a"
  }
}

addPhoneNumberToCart#

Add a phone number to a cart.

Input: AddPhoneNumberToCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
phone_number
PhoneNumberInput!
RequiredPhone number details

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation AddPhone($input: AddPhoneNumberToCartInput!) {
  addPhoneNumberToCart(input: $input) {
    cart {
      id
      phone_number {
        country_code
        national
        number
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "phone_number": {
      "country_code": "NL",
      "national": "612345678"
    }
  }
}

addPickUpPointToCart#

Set a pickup point for cart delivery.

Input: AddPickUpPointToCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
pick_up_point_id
String!
RequiredThe ID of the pickup point

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation AddPickUp($input: AddPickUpPointToCartInput!) {
  addPickUpPointToCart(input: $input) {
    cart {
      id
      delivery {
        address {
          address_line_1
          locality
        }
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "pick_up_point_id": "pup_f6a7b8c9-d0e1-2345-6789-0abcdef12345"
  }
}

removeCustomerFromCart#

Remove the customer from a cart.

Input: RemoveCustomerFromCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation RemoveCustomer($input: RemoveCustomerFromCartInput!) {
  removeCustomerFromCart(input: $input) {
    cart {
      id
      customer {
        contact {
          email
        }
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a"
  }
}

setCountryCodeForCart#

Set the country code for the cart (affects VAT/tax calculations).

Input: SetCountryCodeForCartInput!

NameTypeRequiredDescription
cart_id
String!
RequiredThe ID of the cart
country_code
String!
RequiredISO country code (e.g. NL, DE, US)

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation SetCountry($input: SetCountryCodeForCartInput!) {
  setCountryCodeForCart(input: $input) {
    cart {
      id
      total
      currency
      vat {
        percentage
        amount
      }
    }
  }
}
{
  "input": {
    "cart_id": "crt_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "country_code": "NL"
  }
}

Order#

createOrder#

Create a new order.

Input: CreateOrderInput!

NameTypeRequiredDescription
channel_id
String!
RequiredThe channel ID to create the order in

Returns: Order

NameTypeRequiredDescription
id
ID!
RequiredThe ID
number
String!
RequiredOrder number
total
Money!
RequiredTotal value
currency
Currency!
RequiredCurrency code

Example#

mutation CreateOrder($input: CreateOrderInput!) {
  createOrder(input: $input) {
    order {
      id
      number
      status
      currency
    }
  }
}
{
  "input": {
    "channel_id": "ch_3c7d1e5f-9a2b-4f8e-b6d0-1234abcd5678"
  }
}

addItemsToOrder#

Add items to an existing order.

Input: AddItemsToOrderInput!

NameTypeRequiredDescription
order_id
String!
RequiredThe order ID
items
[OrderItemInput!]!
RequiredItems to add

Returns: Order

NameTypeRequiredDescription
id
ID!
RequiredThe ID
number
String!
RequiredOrder number
total
Money!
RequiredTotal value
currency
Currency!
RequiredCurrency code

Example#

mutation AddItems($input: AddItemsToOrderInput!) {
  addItemsToOrder(input: $input) {
    order {
      id
      items {
        sku
        label
        quantity
        total
      }
    }
  }
}
{
  "input": {
    "order_id": "ord_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "items": [
      { "sku": "BLK-HOODIE-M", "quantity": 2 }
    ]
  }
}

addCustomerToOrder#

Assign a customer to an order.

Input: AddCustomerToOrderInput!

NameTypeRequiredDescription
order_id
String!
RequiredThe order ID
email
String!
RequiredCustomer email
given_name
String!
RequiredFirst name
family_name
String!
RequiredLast name

Returns: Order

NameTypeRequiredDescription
id
ID!
RequiredThe ID
number
String!
RequiredOrder number
total
Money!
RequiredTotal value
currency
Currency!
RequiredCurrency code

Example#

mutation AddCustomer($input: AddCustomerToOrderInput!) {
  addCustomerToOrder(input: $input) {
    order {
      id
      customer {
        contact {
          email
          given_name
          family_name
        }
      }
    }
  }
}
{
  "input": {
    "order_id": "ord_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "email": "[email protected]",
    "given_name": "Jan",
    "family_name": "de Vries"
  }
}

addBillingAddressToOrder#

Set billing address on an order.

Input: AddBillingAddressToOrderInput!

NameTypeRequiredDescription
order_id
String!
RequiredThe order ID
address
AddressInput!
RequiredThe billing address

Returns: Order

NameTypeRequiredDescription
id
ID!
RequiredThe ID
number
String!
RequiredOrder number
total
Money!
RequiredTotal value
currency
Currency!
RequiredCurrency code

Example#

mutation AddBilling($input: AddBillingAddressToOrderInput!) {
  addBillingAddressToOrder(input: $input) {
    order {
      id
      billing {
        address {
          address_line_1
          locality
          postal_code
          country_code
        }
      }
    }
  }
}
{
  "input": {
    "order_id": "ord_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "address": {
      "address_line_1": "Keizersgracht 313",
      "locality": "Amsterdam",
      "postal_code": "1016 EE",
      "country_code": "NL"
    }
  }
}

addShippingAddressToOrder#

Set shipping address on an order.

Input: AddShippingAddressToOrderInput!

NameTypeRequiredDescription
order_id
String!
RequiredThe order ID
address
AddressInput!
RequiredThe shipping address

Returns: Order

NameTypeRequiredDescription
id
ID!
RequiredThe ID
number
String!
RequiredOrder number
total
Money!
RequiredTotal value
currency
Currency!
RequiredCurrency code

Example#

mutation AddShipping($input: AddShippingAddressToOrderInput!) {
  addShippingAddressToOrder(input: $input) {
    order {
      id
      delivery {
        address {
          address_line_1
          locality
          postal_code
          country_code
        }
      }
    }
  }
}
{
  "input": {
    "order_id": "ord_72fca344-2a6f-4c3e-b4ca-029920b2522a",
    "address": {
      "address_line_1": "Herengracht 401",
      "locality": "Amsterdam",
      "postal_code": "1017 BP",
      "country_code": "NL"
    }
  }
}

cancelOrderItems#

Cancel items on an order.

Input: CancelOrderItemsInput!

NameTypeRequiredDescription
item_ids
[String!]!
RequiredIDs of the items to cancel

Returns: Order

NameTypeRequiredDescription
id
ID!
RequiredThe ID
number
String!
RequiredOrder number
total
Money!
RequiredTotal value
currency
Currency!
RequiredCurrency code

Example#

mutation Cancel($input: CancelOrderItemsInput!) {
  cancelOrderItems(input: $input) {
    order {
      id
      items {
        id
        is_cancelled
      }
    }
  }
}
{
  "input": {
    "item_ids": ["oi_5a6b7c8d-9e0f-1234-5678-9abcdef01234"]
  }
}

Organisation#

createOrganisation#

Create a new organisation.

Input: CreateOrganisationInput!

NameTypeRequiredDescription
name
String!
RequiredOrganisation name
type
OrganisationType!
RequiredOrganisation type
NameTypeRequiredDescription
organisation
Organisation!
RequiredThe created organisation

Example#

mutation CreateOrg($input: CreateOrganisationInput!) {
  createOrganisation(input: $input) {
    organisation {
      id
      name
      type
      number
    }
  }
}
{
  "input": {
    "name": "Bakkerij De Vries B.V.",
    "type": "DEFAULT"
  }
}

updateOrganisation#

Update an existing organisation.

Input: UpdateOrganisationInput!

NameTypeRequiredDescription
id
String!
RequiredThe organisation ID
name
String
OptionalNew name
NameTypeRequiredDescription
organisation
Organisation!
RequiredThe updated organisation

Example#

mutation UpdateOrg($input: UpdateOrganisationInput!) {
  updateOrganisation(input: $input) {
    organisation {
      id
      name
    }
  }
}
{
  "input": {
    "id": "org_b2c3d4e5-f6a7-8901-2345-67890abcdef0",
    "name": "Bakkerij De Vries & Zonen B.V."
  }
}

Payment#

executePayment#

Execute a payment for an order.

Input: ExecutePaymentInput!

NameTypeRequiredDescription
payment_id
String!
RequiredThe ID of the payment to execute (obtained from `addPaymentMethodToOrder`)
NameTypeRequiredDescription
payment
Payment
OptionalThe payment record

Example#

mutation Pay($input: ExecutePaymentInput!) {
  executePayment(input: $input) {
    payment {
      id
      status
      amount
      return_url
    }
  }
}
{
  "input": {
    "payment_id": "pay_d4e5f6a7-b8c9-0123-4567-890abcdef012"
  }
}

createRefund#

Create a refund for an order payment.

Input: CreateRefundInput!

NameTypeRequiredDescription
payment_id
String!
RequiredThe payment ID to refund
amount
Int!
RequiredAmount to refund (in cents)
NameTypeRequiredDescription
payment
Payment
OptionalThe refund payment record

Example#

mutation Refund($input: CreateRefundInput!) {
  createRefund(input: $input) {
    payment {
      id
      amount
      status
      is_refund
    }
  }
}
{
  "input": {
    "payment_id": "pay_d4e5f6a7-b8c9-0123-4567-890abcdef012",
    "amount": 2499
  }
}

Customer authentication#

These mutations require a storefront token in the Authorization header.

logInCustomer#

Authenticate a customer with email and password. Returns a short-lived session token.

Input: LogInCustomerInput!

NameTypeRequiredDescription
email
String!
RequiredCustomer's email address
password
String!
RequiredCustomer's password
NameTypeRequiredDescription
token
String!
RequiredSession token (Bearer)
expires_at
Int64!
RequiredExpiry as Unix milliseconds

Example#

mutation LogIn($input: LogInCustomerInput!) {
  logInCustomer(input: $input) {
    token
    expires_at
  }
}
{
  "input": {
    "email": "[email protected]",
    "password": "s3cur3Pa$$w0rd"
  }
}

registerCustomer#

Register a new customer account. Returns a session token on success.

Input: RegisterCustomerInput!

NameTypeRequiredDescription
email
String!
RequiredEmail address
password
String!
RequiredPassword
given_name
String
OptionalFirst name
additional_name
String
OptionalMiddle name
family_name
String
OptionalLast name
NameTypeRequiredDescription
token
String!
RequiredSession token (Bearer)
expires_at
Int64!
RequiredExpiry as Unix milliseconds

Example#

mutation Register($input: RegisterCustomerInput!) {
  registerCustomer(input: $input) {
    token
    expires_at
  }
}
{
  "input": {
    "email": "[email protected]",
    "password": "s3cur3Pa$$w0rd",
    "given_name": "Jan",
    "family_name": "de Vries"
  }
}

requestCustomerPasswordReset#

Send a password reset email to a customer.

Input: RequestCustomerPasswordResetInput!

NameTypeRequiredDescription
email
String!
RequiredThe customer's email address
NameTypeRequiredDescription
is_successful
Boolean!
RequiredWhether the reset email was sent

Example#

mutation RequestReset($input: RequestCustomerPasswordResetInput!) {
  requestCustomerPasswordReset(input: $input) {
    is_successful
  }
}
{
  "input": {
    "email": "[email protected]"
  }
}

resetCustomerPassword#

Reset a customer password using a token received by email.

Input: ResetCustomerPasswordInput!

NameTypeRequiredDescription
token
String!
RequiredThe reset token from the email link
password
String!
RequiredThe new password
NameTypeRequiredDescription
is_successful
Boolean!
RequiredWhether the password was reset

Example#

mutation ResetPassword($input: ResetCustomerPasswordInput!) {
  resetCustomerPassword(input: $input) {
    is_successful
  }
}
{
  "input": {
    "token": "rst_a1b2c3d4e5f6789012345678901234567890abcd",
    "password": "newS3cur3Pa$$w0rd"
  }
}

Send a new verification link to an unverified customer.

Input: RequestCustomerVerificationLinkInput!

NameTypeRequiredDescription
email
String!
RequiredThe customer's email address
NameTypeRequiredDescription
is_successful
Boolean!
RequiredWhether the link was sent

Example#

mutation RequestVerification($input: RequestCustomerVerificationLinkInput!) {
  requestCustomerVerificationLink(input: $input) {
    is_successful
  }
}
{
  "input": {
    "email": "[email protected]"
  }
}

verifyCustomer#

Verify a customer account using a token received by email.

Input: VerifyCustomerInput!

NameTypeRequiredDescription
token
String!
RequiredThe verification token from the email link
NameTypeRequiredDescription
token
String!
RequiredSession token (Bearer)
expires_at
Int64!
RequiredExpiry as Unix milliseconds

Example#

mutation Verify($input: VerifyCustomerInput!) {
  verifyCustomer(input: $input) {
    token
    expires_at
  }
}
{
  "input": {
    "token": "vfy_b2c3d4e5f6a7890123456789012345678901bcde"
  }
}

Account#

These mutations require a user token.

updateAccount#

Update the authenticated account's profile.

Input: UpdateAccountInput!

NameTypeRequiredDescription
given_name
String
OptionalFirst name
additional_name
String
OptionalMiddle name
family_name
String
OptionalLast name

Returns: Account

NameTypeRequiredDescription
email
String!
RequiredEmail address
given_name
String!
RequiredFirst name
additional_name
String!
RequiredMiddle name
family_name
String!
RequiredLast name

Example#

mutation UpdateAccount($input: UpdateAccountInput!) {
  updateAccount(input: $input) {
    account {
      given_name
      family_name
      email
    }
  }
}
{
  "input": {
    "given_name": "Jan",
    "family_name": "de Vries"
  }
}

reorder#

Reorder a previous order. Adds all items from the referenced order to a new cart.

Input: ReorderInput!

NameTypeRequiredDescription
order_id
String!
RequiredThe ID of the order to reorder

Returns: Cart

NameTypeRequiredDescription
id
ID!
RequiredThe ID of the cart
number
String!
RequiredCart number
total
Money!
RequiredTotal value
subtotal
Money!
RequiredTotal before discounts

Example#

mutation Reorder($input: ReorderInput!) {
  reorder(input: $input) {
    cart {
      id
      items {
        sku
        quantity
      }
    }
  }
}
{
  "input": {
    "order_id": "ord_72fca344-2a6f-4c3e-b4ca-029920b2522a"
  }
}

Contact#

createContact#

Create a new contact.

Input: CreateContactInput!

NameTypeRequiredDescription
email
String!
RequiredEmail address
given_name
String
OptionalFirst name
additional_name
String
OptionalMiddle name
family_name
String
OptionalLast name
locale
String
OptionalLocale (e.g. nl_NL)

Returns: Contact

NameTypeRequiredDescription
id
ID!
RequiredThe ID
email
String!
RequiredEmail address
given_name
String!
RequiredFirst name
family_name
String
OptionalLast name

Example#

mutation CreateContact($input: CreateContactInput!) {
  createContact(input: $input) {
    contact {
      id
      email
      given_name
      family_name
    }
  }
}
{
  "input": {
    "email": "[email protected]",
    "given_name": "Lisa",
    "family_name": "Jansen"
  }
}

updateContact#

Update an existing contact.

Input: UpdateContactInput!

NameTypeRequiredDescription
id
String!
RequiredThe ID of the contact
given_name
String
OptionalFirst name
additional_name
String
OptionalMiddle name
family_name
String
OptionalLast name
locale
String
OptionalLocale

Returns: Contact

NameTypeRequiredDescription
id
ID!
RequiredThe ID
email
String!
RequiredEmail address
given_name
String!
RequiredFirst name
family_name
String
OptionalLast name

Example#

mutation UpdateContact($input: UpdateContactInput!) {
  updateContact(input: $input) {
    contact {
      id
      given_name
      family_name
    }
  }
}
{
  "input": {
    "id": "con_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "given_name": "Lisa",
    "family_name": "Jansen-de Boer"
  }
}

addBillingAddressToContact#

Add a billing address to a contact.

Input: AddBillingAddressToContactInput!

NameTypeRequiredDescription
contact_id
String!
RequiredThe ID of the contact
address
AddressInput!
RequiredThe billing address

Returns: Contact

NameTypeRequiredDescription
id
ID!
RequiredThe ID
email
String!
RequiredEmail address
given_name
String!
RequiredFirst name
family_name
String
OptionalLast name

Example#

mutation AddBillingAddress($input: AddBillingAddressToContactInput!) {
  addBillingAddressToContact(input: $input) {
    contact {
      id
      addressing {
        billing {
          primary {
            address_line_1
            locality
            country_code
          }
        }
      }
    }
  }
}
{
  "input": {
    "contact_id": "con_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "address": {
      "address_line_1": "Keizersgracht 313",
      "locality": "Amsterdam",
      "postal_code": "1016 EE",
      "country_code": "NL"
    }
  }
}

addShippingAddressToContact#

Add a shipping address to a contact.

Input: AddShippingAddressToContactInput!

NameTypeRequiredDescription
contact_id
String!
RequiredThe ID of the contact
address
AddressInput!
RequiredThe shipping address

Returns: Contact

NameTypeRequiredDescription
id
ID!
RequiredThe ID
email
String!
RequiredEmail address
given_name
String!
RequiredFirst name
family_name
String
OptionalLast name

Example#

mutation AddShippingAddress($input: AddShippingAddressToContactInput!) {
  addShippingAddressToContact(input: $input) {
    contact {
      id
      addressing {
        shipping {
          primary {
            address_line_1
            locality
            country_code
          }
        }
      }
    }
  }
}
{
  "input": {
    "contact_id": "con_a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "address": {
      "address_line_1": "Herengracht 401",
      "locality": "Amsterdam",
      "postal_code": "1017 BP",
      "country_code": "NL"
    }
  }
}

Wishlist#

createWishlist#

Create a new wishlist. Returns a token used in subsequent wishlist operations.

Input: CreateWishlistInput!

NameTypeRequiredDescription
label
String
OptionalOptional label

Returns: Wishlist

NameTypeRequiredDescription
label
String!
RequiredLabel
token
String!
RequiredToken identifier
items
[WishlistItem!]!
RequiredItems on the wishlist
expires_at
DateTime!
RequiredExpiration date

Example#

mutation CreateWishlist($input: CreateWishlistInput!) {
  createWishlist(input: $input) {
    wishlist {
      token
      label
    }
  }
}
{
  "input": {
    "label": "Mijn verlanglijst"
  }
}

addItemToWishlist#

Add a product to a wishlist by SKU.

Input: AddItemToWishlistInput!

NameTypeRequiredDescription
token
String!
RequiredThe wishlist token
sku
String!
RequiredThe SKU to add

Returns: Wishlist

NameTypeRequiredDescription
label
String!
RequiredLabel
token
String!
RequiredToken identifier
items
[WishlistItem!]!
RequiredItems on the wishlist
expires_at
DateTime!
RequiredExpiration date

Example#

mutation AddToWishlist($input: AddItemToWishlistInput!) {
  addItemToWishlist(input: $input) {
    wishlist {
      token
      items {
        sku
        added_at
      }
    }
  }
}
{
  "input": {
    "token": "wl_c9d0e1f2-a3b4-5678-90ab-cdef01234567",
    "sku": "BLK-HOODIE-M"
  }
}

removeItemFromWishlist#

Remove a product from a wishlist.

Input: RemoveItemFromWishlistInput!

NameTypeRequiredDescription
token
String!
RequiredThe wishlist token
sku
String!
RequiredThe SKU to remove

Returns: Wishlist

NameTypeRequiredDescription
label
String!
RequiredLabel
token
String!
RequiredToken identifier
items
[WishlistItem!]!
RequiredItems on the wishlist
expires_at
DateTime!
RequiredExpiration date

Example#

mutation RemoveFromWishlist($input: RemoveItemFromWishlistInput!) {
  removeItemFromWishlist(input: $input) {
    wishlist {
      token
      items {
        sku
      }
    }
  }
}
{
  "input": {
    "token": "wl_c9d0e1f2-a3b4-5678-90ab-cdef01234567",
    "sku": "BLK-HOODIE-M"
  }
}

updateWishlist#

Update the label of a wishlist.

Input: UpdateWishlistInput!

NameTypeRequiredDescription
token
String!
RequiredThe wishlist token
label
String!
RequiredNew label

Returns: Wishlist

NameTypeRequiredDescription
label
String!
RequiredLabel
token
String!
RequiredToken identifier
items
[WishlistItem!]!
RequiredItems on the wishlist
expires_at
DateTime!
RequiredExpiration date

Example#

mutation UpdateWishlist($input: UpdateWishlistInput!) {
  updateWishlist(input: $input) {
    wishlist {
      token
      label
    }
  }
}
{
  "input": {
    "token": "wl_c9d0e1f2-a3b4-5678-90ab-cdef01234567",
    "label": "Verlanglijst voor Sint"
  }
}

deleteWishlist#

Delete a wishlist.

Input: DeleteWishlistInput!

NameTypeRequiredDescription
token
String!
RequiredThe wishlist token

Returns: Wishlist

NameTypeRequiredDescription
label
String!
RequiredLabel
token
String!
RequiredToken identifier
items
[WishlistItem!]!
RequiredItems on the wishlist
expires_at
DateTime!
RequiredExpiration date

Example#

mutation DeleteWishlist($input: DeleteWishlistInput!) {
  deleteWishlist(input: $input) {
    wishlist {
      token
    }
  }
}
{
  "input": {
    "token": "wl_c9d0e1f2-a3b4-5678-90ab-cdef01234567"
  }
}

Product viewing history#

createProductViewingHistory#

Create a new product viewing history list. Returns a token used in subsequent calls.

Input: CreateProductViewingHistoryInput!

NameTypeRequiredDescription
label
String
OptionalOptional label
NameTypeRequiredDescription
productViewingHistory
ProductViewingHistory!
RequiredThe created history list

Example#

mutation CreateHistory($input: CreateProductViewingHistoryInput!) {
  createProductViewingHistory(input: $input) {
    productViewingHistory {
      token
    }
  }
}
{
  "input": {
    "label": "Recently viewed"
  }
}

addItemToProductViewingHistory#

Record a product view.

Input: AddItemToProductViewingHistoryInput!

NameTypeRequiredDescription
token
String!
RequiredThe viewing history token
sku
String!
RequiredThe SKU that was viewed
NameTypeRequiredDescription
productViewingHistory
ProductViewingHistory!
RequiredThe updated history list

Example#

mutation RecordView($input: AddItemToProductViewingHistoryInput!) {
  addItemToProductViewingHistory(input: $input) {
    productViewingHistory {
      token
      items {
        sku
        viewed_at
      }
    }
  }
}
{
  "input": {
    "token": "pvh_b8c9d0e1-f2a3-4567-890a-bcdef0123456",
    "sku": "BLK-HOODIE-M"
  }
}

Idempotency#

For critical operations (e.g. confirmCart, payment mutations), include an idempotency key to safely retry requests without duplicating the operation:

Idempotency-Key: your-unique-key-here
Query Runnerhttps://afosto.app/graphql

No query loaded

Click play on any code block in the docs to load a query here.