{
  "openapi": "3.1.0",
  "info": {
    "title": "Commerce Orbit storefront API",
    "version": "1",
    "summary": "Read the shop, products and collections, run a cart, check out and show the order from your own website.",
    "description": "The storefront API lets your own website show products with live prices and stock, run a cart and take orders. It needs no key: it returns what the hosted shop shows anyway, and payments go straight from the shopper's browser to the shop's own Stripe account. A key is optional: it counts your requests, and a secret key also reads draft products for a preview.\n\nAnswers are JSON. A successful answer has the result in data; an error has error, with a code and a message you can show to shoppers. Amounts are whole minor units in the currency given.\n\nAny website may read the shop, products and collections from a browser. Carts, checkout, orders, returns and customer accounts answer only the shop's Website and Allowed websites in Settings, and servers.\n\nRequests are limited per network (IP address), with no rate-limit headers: reading the shop, products and collections allows 120 a minute for each shop, and each other endpoint names its own limit on its 429 answer, which has the code rate_limited. Wait a minute before trying again.",
    "contact": {
      "name": "Bifröst Orbit",
      "url": "https://docs.bifrostorbit.com/",
      "email": "hello@bifrostorbit.com"
    },
    "termsOfService": "https://bifrostorbit.com/legal/terms/"
  },
  "servers": [
    {
      "url": "https://app.bifrostorbit.com/commerce/api/public",
      "description": "Production"
    },
    {
      "url": "https://stage.bifrostorbit.com/commerce/api/public",
      "description": "Staging"
    }
  ],
  "tags": [
    {
      "name": "Shop",
      "description": "The shop's name, currencies and languages."
    },
    {
      "name": "Catalogue",
      "description": "Products and collections, readable from any website."
    },
    {
      "name": "Carts",
      "description": "Carts and checkout, from the shop's own websites."
    },
    {
      "name": "Orders",
      "description": "The order and its receipt."
    },
    {
      "name": "Returns",
      "description": "Ask for and follow a return."
    },
    {
      "name": "Gift cards",
      "description": "A gift card's balance."
    },
    {
      "name": "Customer accounts",
      "description": "Sign-in with an email code, the customer's account and personal prices."
    }
  ],
  "externalDocs": {
    "url": "https://docs.bifrostorbit.com/commerce/developers/storefront-api/",
    "description": "The storefront API guide"
  },
  "paths": {
    "/{shop}": {
      "get": {
        "operationId": "getShop",
        "tags": [
          "Shop"
        ],
        "summary": "The shop",
        "description": "The shop's name, logo, currencies and languages. Cacheable for 60 seconds.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          }
        ],
        "responses": {
          "200": {
            "description": "The shop.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Shop"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "slug": "northwilds",
                    "name": "Northwilds",
                    "logoUrl": "https://media.northwilds.com/brand/logo.svg",
                    "colour": "#1f2937",
                    "currency": "NOK",
                    "currencies": [
                      "NOK",
                      "EUR"
                    ],
                    "locales": [
                      "nb",
                      "en"
                    ],
                    "defaultLocale": "nb",
                    "pricesIncludeTax": true,
                    "shopUrl": "https://app.bifrostorbit.com/commerce/shop/northwilds",
                    "termsUrl": "https://northwilds.com/terms/",
                    "returnsDays": 30
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A key that reads drafts, sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "A key that reads drafts must stay on your server. Call the API from your server, or use a key without drafts in the browser."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 120 requests a minute from one network for this shop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": true
        }
      }
    },
    "/{shop}/products": {
      "get": {
        "operationId": "listProducts",
        "tags": [
          "Catalogue"
        ],
        "summary": "List products",
        "description": "Active products, by title. With a key that reads drafts, draft products too. There are no pages: the answer holds up to limit products, so narrow it with tag, collection or query, or ask for ids or slugs. Cacheable for 30 seconds, unless a customer token or a draft key is sent.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Up to 100 product ids, separated by commas. The answer keeps your order.",
            "schema": {
              "type": "string"
            },
            "example": "6650f1c2a9e4b1d2c3f41001,6650f1c2a9e4b1d2c3f41003"
          },
          {
            "name": "slugs",
            "in": "query",
            "description": "Up to 100 product addresses, separated by commas.",
            "schema": {
              "type": "string"
            },
            "example": "fjellvind-down-jacket,tind-40-pack"
          },
          {
            "name": "tag",
            "in": "query",
            "description": "Only products with this tag.",
            "schema": {
              "type": "string"
            },
            "example": "winter"
          },
          {
            "name": "collection",
            "in": "query",
            "description": "Only products in this collection, by address or id, in the collection's order.",
            "schema": {
              "type": "string"
            },
            "example": "hiking-gear"
          },
          {
            "name": "query",
            "in": "query",
            "description": "Products whose title contains this.",
            "schema": {
              "type": "string"
            },
            "example": "jacket"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "How many. 100 unless you say, at most 250.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 250,
              "default": 100
            },
            "example": 24
          },
          {
            "name": "locale",
            "in": "query",
            "description": "A language, such as nb. Without it, or with one the shop doesn't offer, the main language.",
            "schema": {
              "type": "string"
            },
            "example": "nb"
          },
          {
            "name": "currency",
            "in": "query",
            "description": "A currency, such as NOK. Prices are the shop's own price in it, never a conversion.",
            "schema": {
              "type": "string"
            },
            "example": "NOK"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "A signed-in customer's token. Answers then carry that customer's prices and stock, and are never cached.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The products.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Product"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "6650f1c2a9e4b1d2c3f41001",
                      "slug": "fjellvind-down-jacket",
                      "title": "Fjellvind down jacket",
                      "summary": "A warm, light down jacket for cold days on the fjell.",
                      "description": "<p>A warm, light down jacket for cold days on the fjell.</p>",
                      "vendor": "Northwilds",
                      "productType": "Jackets",
                      "tags": [
                        "hiking",
                        "winter"
                      ],
                      "options": [
                        {
                          "name": "Size",
                          "values": [
                            "S",
                            "M",
                            "L"
                          ]
                        }
                      ],
                      "variants": [
                        {
                          "id": "6650f1c2a9e4b1d2c3f41101",
                          "title": "M",
                          "options": [
                            "M"
                          ],
                          "sku": "NW-FJV-M",
                          "price": 349900,
                          "compareAtPrice": null,
                          "available": true,
                          "quantity": 12,
                          "listPrice": null,
                          "priceSource": "shop",
                          "branches": null,
                          "volume": [],
                          "quantityRule": null,
                          "requiresShipping": true,
                          "digital": false,
                          "plans": [],
                          "metafields": {}
                        }
                      ],
                      "images": [
                        {
                          "url": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp",
                          "alt": "The Fjellvind down jacket in dark green"
                        }
                      ],
                      "specs": [
                        {
                          "label": "Weight",
                          "value": "620 g"
                        }
                      ],
                      "price": {
                        "min": 349900,
                        "max": 349900,
                        "currency": "NOK",
                        "compareAt": null
                      },
                      "available": true,
                      "status": "active",
                      "seo": {
                        "title": "Fjellvind down jacket",
                        "description": "A warm, light down jacket for cold days on the fjell."
                      },
                      "url": "https://app.bifrostorbit.com/commerce/shop/northwilds/products/fjellvind-down-jacket",
                      "locale": "en",
                      "updatedAt": "2026-11-02T09:30:00.000Z",
                      "stockSyncedAt": null,
                      "pricing": {
                        "source": "shop",
                        "account": null,
                        "checkedAt": null
                      },
                      "giftCard": false,
                      "metafields": {},
                      "bundle": null
                    },
                    {
                      "id": "6650f1c2a9e4b1d2c3f41002",
                      "slug": "stig-trekking-poles",
                      "title": "Stig trekking poles",
                      "summary": "Folding carbon poles that pack small.",
                      "description": "<p>Folding carbon poles that pack small.</p>",
                      "vendor": "Northwilds",
                      "productType": "Poles",
                      "tags": [
                        "hiking",
                        "winter"
                      ],
                      "options": [],
                      "variants": [
                        {
                          "id": "6650f1c2a9e4b1d2c3f41201",
                          "title": "Default",
                          "options": [],
                          "sku": "NW-STIG",
                          "price": 89900,
                          "compareAtPrice": null,
                          "available": true,
                          "quantity": 30,
                          "listPrice": null,
                          "priceSource": "shop",
                          "branches": null,
                          "volume": [],
                          "quantityRule": null,
                          "requiresShipping": true,
                          "digital": false,
                          "plans": [],
                          "metafields": {}
                        }
                      ],
                      "images": [
                        {
                          "url": "https://media.northwilds.com/gear/stig-trekking-poles.webp",
                          "alt": "A pair of Stig trekking poles"
                        }
                      ],
                      "specs": [
                        {
                          "label": "Weight",
                          "value": "480 g a pair"
                        }
                      ],
                      "price": {
                        "min": 89900,
                        "max": 89900,
                        "currency": "NOK",
                        "compareAt": null
                      },
                      "available": true,
                      "status": "active",
                      "seo": {
                        "title": "Stig trekking poles",
                        "description": "Folding carbon poles that pack small."
                      },
                      "url": "https://app.bifrostorbit.com/commerce/shop/northwilds/products/stig-trekking-poles",
                      "locale": "en",
                      "updatedAt": "2026-11-02T09:30:00.000Z",
                      "stockSyncedAt": null,
                      "pricing": {
                        "source": "shop",
                        "account": null,
                        "checkedAt": null
                      },
                      "giftCard": false,
                      "metafields": {},
                      "bundle": null
                    },
                    {
                      "id": "6650f1c2a9e4b1d2c3f41003",
                      "slug": "tind-40-pack",
                      "title": "Tind 40 litre pack",
                      "summary": "A 40 litre pack for long days and hut-to-hut trips.",
                      "description": "<p>A 40 litre pack for long days and hut-to-hut trips.</p>",
                      "vendor": "Northwilds",
                      "productType": "Packs",
                      "tags": [
                        "hiking",
                        "winter"
                      ],
                      "options": [],
                      "variants": [
                        {
                          "id": "6650f1c2a9e4b1d2c3f41301",
                          "title": "Default",
                          "options": [],
                          "sku": "NW-TIND40",
                          "price": 199900,
                          "compareAtPrice": null,
                          "available": true,
                          "quantity": 8,
                          "listPrice": null,
                          "priceSource": "shop",
                          "branches": null,
                          "volume": [],
                          "quantityRule": null,
                          "requiresShipping": true,
                          "digital": false,
                          "plans": [],
                          "metafields": {}
                        }
                      ],
                      "images": [
                        {
                          "url": "https://media.northwilds.com/gear/tind-40-pack.webp",
                          "alt": "The Tind 40 litre pack on a rock"
                        }
                      ],
                      "specs": [
                        {
                          "label": "Weight",
                          "value": "1.4 kg"
                        }
                      ],
                      "price": {
                        "min": 199900,
                        "max": 199900,
                        "currency": "NOK",
                        "compareAt": null
                      },
                      "available": true,
                      "status": "active",
                      "seo": {
                        "title": "Tind 40 litre pack",
                        "description": "A 40 litre pack for long days and hut-to-hut trips."
                      },
                      "url": "https://app.bifrostorbit.com/commerce/shop/northwilds/products/tind-40-pack",
                      "locale": "en",
                      "updatedAt": "2026-11-02T09:30:00.000Z",
                      "stockSyncedAt": null,
                      "pricing": {
                        "source": "shop",
                        "account": null,
                        "checkedAt": null
                      },
                      "giftCard": false,
                      "metafields": {},
                      "bundle": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A key that reads drafts, sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "A key that reads drafts must stay on your server. Call the API from your server, or use a key without drafts in the browser."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 120 requests a minute from one network for this shop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": true
        }
      }
    },
    "/{shop}/products/{product}": {
      "get": {
        "operationId": "getProduct",
        "tags": [
          "Catalogue"
        ],
        "summary": "Get a product",
        "description": "One product, by address or id. Cacheable for 30 seconds.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "product",
            "in": "path",
            "required": true,
            "description": "The product's address or id.",
            "schema": {
              "type": "string"
            },
            "example": "fjellvind-down-jacket"
          },
          {
            "name": "locale",
            "in": "query",
            "description": "A language, such as nb. Without it, or with one the shop doesn't offer, the main language.",
            "schema": {
              "type": "string"
            },
            "example": "nb"
          },
          {
            "name": "currency",
            "in": "query",
            "description": "A currency, such as NOK. Prices are the shop's own price in it, never a conversion.",
            "schema": {
              "type": "string"
            },
            "example": "NOK"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "A signed-in customer's token. Answers then carry that customer's prices and stock, and are never cached.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The product.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Product"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "6650f1c2a9e4b1d2c3f41001",
                    "slug": "fjellvind-down-jacket",
                    "title": "Fjellvind down jacket",
                    "summary": "A warm, light down jacket for cold days on the fjell.",
                    "description": "<p>A warm, light down jacket for cold days on the fjell.</p>",
                    "vendor": "Northwilds",
                    "productType": "Jackets",
                    "tags": [
                      "hiking",
                      "winter"
                    ],
                    "options": [
                      {
                        "name": "Size",
                        "values": [
                          "S",
                          "M",
                          "L"
                        ]
                      }
                    ],
                    "variants": [
                      {
                        "id": "6650f1c2a9e4b1d2c3f41101",
                        "title": "M",
                        "options": [
                          "M"
                        ],
                        "sku": "NW-FJV-M",
                        "price": 349900,
                        "compareAtPrice": null,
                        "available": true,
                        "quantity": 12,
                        "listPrice": null,
                        "priceSource": "shop",
                        "branches": null,
                        "volume": [],
                        "quantityRule": null,
                        "requiresShipping": true,
                        "digital": false,
                        "plans": [],
                        "metafields": {}
                      }
                    ],
                    "images": [
                      {
                        "url": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp",
                        "alt": "The Fjellvind down jacket in dark green"
                      }
                    ],
                    "specs": [
                      {
                        "label": "Weight",
                        "value": "620 g"
                      }
                    ],
                    "price": {
                      "min": 349900,
                      "max": 349900,
                      "currency": "NOK",
                      "compareAt": null
                    },
                    "available": true,
                    "status": "active",
                    "seo": {
                      "title": "Fjellvind down jacket",
                      "description": "A warm, light down jacket for cold days on the fjell."
                    },
                    "url": "https://app.bifrostorbit.com/commerce/shop/northwilds/products/fjellvind-down-jacket",
                    "locale": "en",
                    "updatedAt": "2026-11-02T09:30:00.000Z",
                    "stockSyncedAt": null,
                    "pricing": {
                      "source": "shop",
                      "account": null,
                      "checkedAt": null
                    },
                    "giftCard": false,
                    "metafields": {},
                    "bundle": null
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A key that reads drafts, sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "A key that reads drafts must stay on your server. Call the API from your server, or use a key without drafts in the browser."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No active product with that address or id. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Product was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 120 requests a minute from one network for this shop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": true
        }
      }
    },
    "/{shop}/collections": {
      "get": {
        "operationId": "listCollections",
        "tags": [
          "Catalogue"
        ],
        "summary": "List collections",
        "description": "Every active collection, by title, without their products. There are no pages. Cacheable for 60 seconds.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Up to 100 collection ids, separated by commas.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "query",
            "description": "A language, such as nb. Without it, or with one the shop doesn't offer, the main language.",
            "schema": {
              "type": "string"
            },
            "example": "nb"
          }
        ],
        "responses": {
          "200": {
            "description": "The collections.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Collection"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "6650f1c2a9e4b1d2c3f42001",
                      "slug": "hiking-gear",
                      "title": "Hiking gear",
                      "description": "What we pack for a day on the fjell.",
                      "image": {
                        "url": "https://media.northwilds.com/gear/tind-40-pack.webp",
                        "alt": "The Tind 40 litre pack on a rock"
                      },
                      "productCount": 3,
                      "url": "https://app.bifrostorbit.com/commerce/shop/northwilds/collections/hiking-gear"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A key that reads drafts, sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "A key that reads drafts must stay on your server. Call the API from your server, or use a key without drafts in the browser."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 120 requests a minute from one network for this shop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": true
        }
      }
    },
    "/{shop}/collections/{collection}": {
      "get": {
        "operationId": "getCollection",
        "tags": [
          "Catalogue"
        ],
        "summary": "Get a collection",
        "description": "One collection, by address or id, with its first products in the collection's order. productCount tells you how many there are in all. Cacheable for 30 seconds.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "collection",
            "in": "path",
            "required": true,
            "description": "The collection's address or id.",
            "schema": {
              "type": "string"
            },
            "example": "hiking-gear"
          },
          {
            "name": "locale",
            "in": "query",
            "description": "A language, such as nb. Without it, or with one the shop doesn't offer, the main language.",
            "schema": {
              "type": "string"
            },
            "example": "nb"
          },
          {
            "name": "currency",
            "in": "query",
            "description": "A currency, such as NOK. Prices are the shop's own price in it, never a conversion.",
            "schema": {
              "type": "string"
            },
            "example": "NOK"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "How many products. 100 unless you say.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 100
            },
            "example": 12
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "A signed-in customer's token. Answers then carry that customer's prices and stock, and are never cached.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The collection with products.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Collection"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "6650f1c2a9e4b1d2c3f42001",
                    "slug": "hiking-gear",
                    "title": "Hiking gear",
                    "description": "What we pack for a day on the fjell.",
                    "image": {
                      "url": "https://media.northwilds.com/gear/tind-40-pack.webp",
                      "alt": "The Tind 40 litre pack on a rock"
                    },
                    "productCount": 3,
                    "url": "https://app.bifrostorbit.com/commerce/shop/northwilds/collections/hiking-gear",
                    "products": [
                      {
                        "id": "6650f1c2a9e4b1d2c3f41003",
                        "slug": "tind-40-pack",
                        "title": "Tind 40 litre pack",
                        "summary": "A 40 litre pack for long days and hut-to-hut trips.",
                        "description": "<p>A 40 litre pack for long days and hut-to-hut trips.</p>",
                        "vendor": "Northwilds",
                        "productType": "Packs",
                        "tags": [
                          "hiking",
                          "winter"
                        ],
                        "options": [],
                        "variants": [
                          {
                            "id": "6650f1c2a9e4b1d2c3f41301",
                            "title": "Default",
                            "options": [],
                            "sku": "NW-TIND40",
                            "price": 199900,
                            "compareAtPrice": null,
                            "available": true,
                            "quantity": 8,
                            "listPrice": null,
                            "priceSource": "shop",
                            "branches": null,
                            "volume": [],
                            "quantityRule": null,
                            "requiresShipping": true,
                            "digital": false,
                            "plans": [],
                            "metafields": {}
                          }
                        ],
                        "images": [
                          {
                            "url": "https://media.northwilds.com/gear/tind-40-pack.webp",
                            "alt": "The Tind 40 litre pack on a rock"
                          }
                        ],
                        "specs": [
                          {
                            "label": "Weight",
                            "value": "1.4 kg"
                          }
                        ],
                        "price": {
                          "min": 199900,
                          "max": 199900,
                          "currency": "NOK",
                          "compareAt": null
                        },
                        "available": true,
                        "status": "active",
                        "seo": {
                          "title": "Tind 40 litre pack",
                          "description": "A 40 litre pack for long days and hut-to-hut trips."
                        },
                        "url": "https://app.bifrostorbit.com/commerce/shop/northwilds/products/tind-40-pack",
                        "locale": "en",
                        "updatedAt": "2026-11-02T09:30:00.000Z",
                        "stockSyncedAt": null,
                        "pricing": {
                          "source": "shop",
                          "account": null,
                          "checkedAt": null
                        },
                        "giftCard": false,
                        "metafields": {},
                        "bundle": null
                      },
                      {
                        "id": "6650f1c2a9e4b1d2c3f41002",
                        "slug": "stig-trekking-poles",
                        "title": "Stig trekking poles",
                        "summary": "Folding carbon poles that pack small.",
                        "description": "<p>Folding carbon poles that pack small.</p>",
                        "vendor": "Northwilds",
                        "productType": "Poles",
                        "tags": [
                          "hiking",
                          "winter"
                        ],
                        "options": [],
                        "variants": [
                          {
                            "id": "6650f1c2a9e4b1d2c3f41201",
                            "title": "Default",
                            "options": [],
                            "sku": "NW-STIG",
                            "price": 89900,
                            "compareAtPrice": null,
                            "available": true,
                            "quantity": 30,
                            "listPrice": null,
                            "priceSource": "shop",
                            "branches": null,
                            "volume": [],
                            "quantityRule": null,
                            "requiresShipping": true,
                            "digital": false,
                            "plans": [],
                            "metafields": {}
                          }
                        ],
                        "images": [
                          {
                            "url": "https://media.northwilds.com/gear/stig-trekking-poles.webp",
                            "alt": "A pair of Stig trekking poles"
                          }
                        ],
                        "specs": [
                          {
                            "label": "Weight",
                            "value": "480 g a pair"
                          }
                        ],
                        "price": {
                          "min": 89900,
                          "max": 89900,
                          "currency": "NOK",
                          "compareAt": null
                        },
                        "available": true,
                        "status": "active",
                        "seo": {
                          "title": "Stig trekking poles",
                          "description": "Folding carbon poles that pack small."
                        },
                        "url": "https://app.bifrostorbit.com/commerce/shop/northwilds/products/stig-trekking-poles",
                        "locale": "en",
                        "updatedAt": "2026-11-02T09:30:00.000Z",
                        "stockSyncedAt": null,
                        "pricing": {
                          "source": "shop",
                          "account": null,
                          "checkedAt": null
                        },
                        "giftCard": false,
                        "metafields": {},
                        "bundle": null
                      },
                      {
                        "id": "6650f1c2a9e4b1d2c3f41001",
                        "slug": "fjellvind-down-jacket",
                        "title": "Fjellvind down jacket",
                        "summary": "A warm, light down jacket for cold days on the fjell.",
                        "description": "<p>A warm, light down jacket for cold days on the fjell.</p>",
                        "vendor": "Northwilds",
                        "productType": "Jackets",
                        "tags": [
                          "hiking",
                          "winter"
                        ],
                        "options": [
                          {
                            "name": "Size",
                            "values": [
                              "S",
                              "M",
                              "L"
                            ]
                          }
                        ],
                        "variants": [
                          {
                            "id": "6650f1c2a9e4b1d2c3f41101",
                            "title": "M",
                            "options": [
                              "M"
                            ],
                            "sku": "NW-FJV-M",
                            "price": 349900,
                            "compareAtPrice": null,
                            "available": true,
                            "quantity": 12,
                            "listPrice": null,
                            "priceSource": "shop",
                            "branches": null,
                            "volume": [],
                            "quantityRule": null,
                            "requiresShipping": true,
                            "digital": false,
                            "plans": [],
                            "metafields": {}
                          }
                        ],
                        "images": [
                          {
                            "url": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp",
                            "alt": "The Fjellvind down jacket in dark green"
                          }
                        ],
                        "specs": [
                          {
                            "label": "Weight",
                            "value": "620 g"
                          }
                        ],
                        "price": {
                          "min": 349900,
                          "max": 349900,
                          "currency": "NOK",
                          "compareAt": null
                        },
                        "available": true,
                        "status": "active",
                        "seo": {
                          "title": "Fjellvind down jacket",
                          "description": "A warm, light down jacket for cold days on the fjell."
                        },
                        "url": "https://app.bifrostorbit.com/commerce/shop/northwilds/products/fjellvind-down-jacket",
                        "locale": "en",
                        "updatedAt": "2026-11-02T09:30:00.000Z",
                        "stockSyncedAt": null,
                        "pricing": {
                          "source": "shop",
                          "account": null,
                          "checkedAt": null
                        },
                        "giftCard": false,
                        "metafields": {},
                        "bundle": null
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A key that reads drafts, sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "A key that reads drafts must stay on your server. Call the API from your server, or use a key without drafts in the browser."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No active collection with that address or id. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Collection was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 120 requests a minute from one network for this shop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": true
        }
      }
    },
    "/{shop}/carts": {
      "post": {
        "operationId": "createCart",
        "tags": [
          "Carts"
        ],
        "summary": "Start a cart",
        "description": "Starts a cart and answers with it. The body takes any of the cart's fields, and source, up to 60 characters, to say where the order came from; it defaults to the calling website. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "A signed-in customer's token. Answers then carry that customer's prices and stock, and are never cached.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CartUpdate",
                "description": "Any cart field, and source."
              },
              "example": {
                "currency": "NOK",
                "locale": "nb",
                "add": [
                  {
                    "variantId": "6650f1c2a9e4b1d2c3f41101",
                    "quantity": 1
                  },
                  {
                    "variantId": "6650f1c2a9e4b1d2c3f41201",
                    "quantity": 1
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new cart.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cart"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "token": "c_Q2xNw7fjK4pLm9Rt",
                    "currency": "NOK",
                    "currencies": [
                      "NOK",
                      "EUR"
                    ],
                    "locale": "nb",
                    "lines": [
                      {
                        "variantId": "6650f1c2a9e4b1d2c3f41101",
                        "productId": "6650f1c2a9e4b1d2c3f41001",
                        "slug": "fjellvind-down-jacket",
                        "title": "Fjellvind down jacket",
                        "variantTitle": "M",
                        "sku": "NW-FJV-M",
                        "image": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp",
                        "quantity": 1,
                        "unitPrice": 349900,
                        "listPrice": 349900,
                        "total": 349900,
                        "available": 12,
                        "problem": null,
                        "priceSource": "shop",
                        "branches": null,
                        "quantityRule": null,
                        "volumePercent": 0,
                        "giftCard": false,
                        "planId": null,
                        "planName": null,
                        "digital": false
                      },
                      {
                        "variantId": "6650f1c2a9e4b1d2c3f41201",
                        "productId": "6650f1c2a9e4b1d2c3f41002",
                        "slug": "stig-trekking-poles",
                        "title": "Stig trekking poles",
                        "variantTitle": null,
                        "sku": "NW-STIG",
                        "image": "https://media.northwilds.com/gear/stig-trekking-poles.webp",
                        "quantity": 1,
                        "unitPrice": 89900,
                        "listPrice": 89900,
                        "total": 89900,
                        "available": 30,
                        "problem": null,
                        "priceSource": "shop",
                        "branches": null,
                        "quantityRule": null,
                        "volumePercent": 0,
                        "giftCard": false,
                        "planId": null,
                        "planName": null,
                        "digital": false
                      }
                    ],
                    "count": 2,
                    "email": null,
                    "name": null,
                    "phone": null,
                    "vatNumber": null,
                    "company": null,
                    "discountCode": null,
                    "discountProblem": null,
                    "shippingAddress": null,
                    "billingAddress": null,
                    "vat": null,
                    "salesTax": null,
                    "verifiedEmail": null,
                    "country": "NO",
                    "shipping": null,
                    "shippingChoices": [
                      {
                        "kind": "rate",
                        "id": "posten-home",
                        "name": "Posten, delivered home",
                        "price": 9900,
                        "free": false,
                        "minDays": 2,
                        "maxDays": 4,
                        "servicePoint": false
                      },
                      {
                        "kind": "pickup",
                        "id": "oslo-shop",
                        "name": "Collect from the Oslo shop",
                        "price": 0,
                        "free": true,
                        "minDays": 0,
                        "maxDays": 1
                      }
                    ],
                    "totals": {
                      "subtotal": 438800,
                      "discountTotal": 0,
                      "shippingTotal": 0,
                      "taxTotal": 87760,
                      "total": 438800,
                      "tax": {
                        "mode": "domestic",
                        "country": "NO",
                        "pricesIncludeTax": true,
                        "lines": [
                          {
                            "rate": 25,
                            "base": 351040,
                            "tax": 87760
                          }
                        ]
                      },
                      "discount": null,
                      "discounts": [],
                      "giftCardTotal": 0,
                      "amountDue": 438800
                    },
                    "offers": [],
                    "giftCards": [],
                    "giftCardProblems": [],
                    "giftCardCodes": [],
                    "badGiftCards": [],
                    "prices": "list",
                    "customer": null,
                    "account": null,
                    "pricesCheckedAt": null,
                    "problems": [],
                    "orderId": null,
                    "needsShipping": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field that isn't valid, with issues.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Enter a valid email address",
                    "issues": [
                      {
                        "code": "invalid_format",
                        "format": "email",
                        "path": [
                          "email"
                        ],
                        "message": "Enter a valid email address"
                      }
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 5 new carts a minute from one network, after a first 10.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It starts a real cart in the shop. Try it in the API playground in Commerce Orbit, with the shop's own products."
        }
      }
    },
    "/{shop}/carts/{token}": {
      "get": {
        "operationId": "getCart",
        "tags": [
          "Carts"
        ],
        "summary": "Read a cart",
        "description": "The cart, priced. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The cart's token, from starting the cart.",
            "schema": {
              "type": "string"
            },
            "example": "c_Q2xNw7fjK4pLm9Rt"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "A signed-in customer's token. Answers then carry that customer's prices and stock, and are never cached.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The cart.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cart"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "token": "c_Q2xNw7fjK4pLm9Rt",
                    "currency": "NOK",
                    "currencies": [
                      "NOK",
                      "EUR"
                    ],
                    "locale": "nb",
                    "lines": [
                      {
                        "variantId": "6650f1c2a9e4b1d2c3f41101",
                        "productId": "6650f1c2a9e4b1d2c3f41001",
                        "slug": "fjellvind-down-jacket",
                        "title": "Fjellvind down jacket",
                        "variantTitle": "M",
                        "sku": "NW-FJV-M",
                        "image": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp",
                        "quantity": 1,
                        "unitPrice": 349900,
                        "listPrice": 349900,
                        "total": 349900,
                        "available": 12,
                        "problem": null,
                        "priceSource": "shop",
                        "branches": null,
                        "quantityRule": null,
                        "volumePercent": 0,
                        "giftCard": false,
                        "planId": null,
                        "planName": null,
                        "digital": false
                      },
                      {
                        "variantId": "6650f1c2a9e4b1d2c3f41201",
                        "productId": "6650f1c2a9e4b1d2c3f41002",
                        "slug": "stig-trekking-poles",
                        "title": "Stig trekking poles",
                        "variantTitle": null,
                        "sku": "NW-STIG",
                        "image": "https://media.northwilds.com/gear/stig-trekking-poles.webp",
                        "quantity": 1,
                        "unitPrice": 89900,
                        "listPrice": 89900,
                        "total": 89900,
                        "available": 30,
                        "problem": null,
                        "priceSource": "shop",
                        "branches": null,
                        "quantityRule": null,
                        "volumePercent": 0,
                        "giftCard": false,
                        "planId": null,
                        "planName": null,
                        "digital": false
                      }
                    ],
                    "count": 2,
                    "email": "kari.nordmann@northwilds.com",
                    "name": "Kari Nordmann",
                    "phone": "+47 912 34 567",
                    "vatNumber": null,
                    "company": null,
                    "discountCode": null,
                    "discountProblem": null,
                    "shippingAddress": {
                      "name": "Kari Nordmann",
                      "company": null,
                      "line1": "Storgata 12",
                      "line2": null,
                      "postalCode": "0155",
                      "city": "Oslo",
                      "region": null,
                      "country": "NO",
                      "phone": "+47 912 34 567"
                    },
                    "billingAddress": null,
                    "vat": null,
                    "salesTax": null,
                    "verifiedEmail": null,
                    "country": "NO",
                    "shipping": {
                      "kind": "rate",
                      "rateId": "posten-home"
                    },
                    "shippingChoices": [
                      {
                        "kind": "rate",
                        "id": "posten-home",
                        "name": "Posten, delivered home",
                        "price": 9900,
                        "free": false,
                        "minDays": 2,
                        "maxDays": 4,
                        "servicePoint": false
                      },
                      {
                        "kind": "pickup",
                        "id": "oslo-shop",
                        "name": "Collect from the Oslo shop",
                        "price": 0,
                        "free": true,
                        "minDays": 0,
                        "maxDays": 1
                      }
                    ],
                    "totals": {
                      "subtotal": 438800,
                      "discountTotal": 0,
                      "shippingTotal": 9900,
                      "taxTotal": 89740,
                      "total": 448700,
                      "tax": {
                        "mode": "domestic",
                        "country": "NO",
                        "pricesIncludeTax": true,
                        "lines": [
                          {
                            "rate": 25,
                            "base": 358960,
                            "tax": 89740
                          }
                        ]
                      },
                      "discount": null,
                      "discounts": [],
                      "giftCardTotal": 0,
                      "amountDue": 448700
                    },
                    "offers": [],
                    "giftCards": [],
                    "giftCardProblems": [],
                    "giftCardCodes": [],
                    "badGiftCards": [],
                    "prices": "list",
                    "customer": null,
                    "account": null,
                    "pricesCheckedAt": null,
                    "problems": [],
                    "orderId": null,
                    "needsShipping": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No cart with that token. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Cart was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "Carts only answer the shop's own websites, so a browser on the docs gets 403. Use the API playground in Commerce Orbit."
        }
      },
      "patch": {
        "operationId": "updateCart",
        "tags": [
          "Carts"
        ],
        "summary": "Change a cart",
        "description": "Send only what changes; null clears a field. Lines whose product isn't active are dropped. Changing a cart while its checkout waits for payment starts the checkout over. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The cart's token, from starting the cart.",
            "schema": {
              "type": "string"
            },
            "example": "c_Q2xNw7fjK4pLm9Rt"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "A signed-in customer's token. Answers then carry that customer's prices and stock, and are never cached.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CartUpdate"
              },
              "example": {
                "email": "kari.nordmann@northwilds.com",
                "name": "Kari Nordmann",
                "shippingAddress": {
                  "name": "Kari Nordmann",
                  "company": null,
                  "line1": "Storgata 12",
                  "line2": null,
                  "postalCode": "0155",
                  "city": "Oslo",
                  "region": null,
                  "country": "NO",
                  "phone": "+47 912 34 567"
                },
                "shipping": {
                  "kind": "rate",
                  "rateId": "posten-home"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cart.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Cart"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "token": "c_Q2xNw7fjK4pLm9Rt",
                    "currency": "NOK",
                    "currencies": [
                      "NOK",
                      "EUR"
                    ],
                    "locale": "nb",
                    "lines": [
                      {
                        "variantId": "6650f1c2a9e4b1d2c3f41101",
                        "productId": "6650f1c2a9e4b1d2c3f41001",
                        "slug": "fjellvind-down-jacket",
                        "title": "Fjellvind down jacket",
                        "variantTitle": "M",
                        "sku": "NW-FJV-M",
                        "image": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp",
                        "quantity": 1,
                        "unitPrice": 349900,
                        "listPrice": 349900,
                        "total": 349900,
                        "available": 12,
                        "problem": null,
                        "priceSource": "shop",
                        "branches": null,
                        "quantityRule": null,
                        "volumePercent": 0,
                        "giftCard": false,
                        "planId": null,
                        "planName": null,
                        "digital": false
                      },
                      {
                        "variantId": "6650f1c2a9e4b1d2c3f41201",
                        "productId": "6650f1c2a9e4b1d2c3f41002",
                        "slug": "stig-trekking-poles",
                        "title": "Stig trekking poles",
                        "variantTitle": null,
                        "sku": "NW-STIG",
                        "image": "https://media.northwilds.com/gear/stig-trekking-poles.webp",
                        "quantity": 1,
                        "unitPrice": 89900,
                        "listPrice": 89900,
                        "total": 89900,
                        "available": 30,
                        "problem": null,
                        "priceSource": "shop",
                        "branches": null,
                        "quantityRule": null,
                        "volumePercent": 0,
                        "giftCard": false,
                        "planId": null,
                        "planName": null,
                        "digital": false
                      }
                    ],
                    "count": 2,
                    "email": "kari.nordmann@northwilds.com",
                    "name": "Kari Nordmann",
                    "phone": "+47 912 34 567",
                    "vatNumber": null,
                    "company": null,
                    "discountCode": null,
                    "discountProblem": null,
                    "shippingAddress": {
                      "name": "Kari Nordmann",
                      "company": null,
                      "line1": "Storgata 12",
                      "line2": null,
                      "postalCode": "0155",
                      "city": "Oslo",
                      "region": null,
                      "country": "NO",
                      "phone": "+47 912 34 567"
                    },
                    "billingAddress": null,
                    "vat": null,
                    "salesTax": null,
                    "verifiedEmail": null,
                    "country": "NO",
                    "shipping": {
                      "kind": "rate",
                      "rateId": "posten-home"
                    },
                    "shippingChoices": [
                      {
                        "kind": "rate",
                        "id": "posten-home",
                        "name": "Posten, delivered home",
                        "price": 9900,
                        "free": false,
                        "minDays": 2,
                        "maxDays": 4,
                        "servicePoint": false
                      },
                      {
                        "kind": "pickup",
                        "id": "oslo-shop",
                        "name": "Collect from the Oslo shop",
                        "price": 0,
                        "free": true,
                        "minDays": 0,
                        "maxDays": 1
                      }
                    ],
                    "totals": {
                      "subtotal": 438800,
                      "discountTotal": 0,
                      "shippingTotal": 9900,
                      "taxTotal": 89740,
                      "total": 448700,
                      "tax": {
                        "mode": "domestic",
                        "country": "NO",
                        "pricesIncludeTax": true,
                        "lines": [
                          {
                            "rate": 25,
                            "base": 358960,
                            "tax": 89740
                          }
                        ]
                      },
                      "discount": null,
                      "discounts": [],
                      "giftCardTotal": 0,
                      "amountDue": 448700
                    },
                    "offers": [],
                    "giftCards": [],
                    "giftCardProblems": [],
                    "giftCardCodes": [],
                    "badGiftCards": [],
                    "prices": "list",
                    "customer": null,
                    "account": null,
                    "pricesCheckedAt": null,
                    "problems": [],
                    "orderId": null,
                    "needsShipping": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No cart with that token. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Cart was not found"
                  }
                }
              }
            }
          },
          "409": {
            "description": "The cart has already been ordered and paid. Start a new one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "conflict",
                    "message": "This cart has already been ordered. Start a new one."
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field that isn't valid, with issues.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Enter a valid email address",
                    "issues": [
                      {
                        "code": "invalid_format",
                        "format": "email",
                        "path": [
                          "email"
                        ],
                        "message": "Enter a valid email address"
                      }
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "Only when the body has giftCards: more than 20 a minute from one network for this shop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It changes data, so it is described here and not run from the docs."
        }
      }
    },
    "/{shop}/carts/{token}/checkout": {
      "post": {
        "operationId": "checkout",
        "tags": [
          "Carts"
        ],
        "summary": "Check out",
        "description": "Creates the order and takes the stock. The cart needs lines, an email, a name, a shipping choice and an address (unless it is collection or only downloads), and no problems. Calling it again before the order is paid cancels the earlier unpaid order and makes a new one. A cart with a subscription line is paid by card only. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The cart's token, from starting the cart.",
            "schema": {
              "type": "string"
            },
            "example": "c_Q2xNw7fjK4pLm9Rt"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "A signed-in customer's token. Answers then carry that customer's prices and stock, and are never cached.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "method": {
                    "type": "string",
                    "description": "card unless you say. Gift cards can't be used with invoice.",
                    "enum": [
                      "card",
                      "invoice"
                    ]
                  }
                },
                "required": []
              },
              "example": {
                "method": "card"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The order, and the payment to take.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Checkout"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "orderId": "6650f1c2a9e4b1d2c3f45001",
                    "reference": "NW1042",
                    "status": "pay",
                    "payment": {
                      "kind": "payment",
                      "clientSecret": "pi_3Q…_secret_…",
                      "publishableKey": "pk_live_…",
                      "amount": 448700,
                      "currency": "NOK"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Something the cart still needs, such as an email address, or a method other than card or invoice.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Add your email address"
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No cart with that token. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Cart was not found"
                  }
                }
              }
            }
          },
          "409": {
            "description": "A problem in the cart, a payment the shop can't take, or price_changed when a MAM account's price changed since the cart showed it: read the cart again.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "conflict",
                    "message": "Gift cards can't be used when paying on invoice. Remove the gift card or pay by card."
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this cart.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It places a real order, takes stock and emails the customer."
        }
      }
    },
    "/{shop}/carts/{token}/verify": {
      "post": {
        "operationId": "verifyCartEmail",
        "tags": [
          "Carts"
        ],
        "summary": "Confirm the shopper's email",
        "description": "Without code, emails a 6-digit code to email and answers { sent: true }. With code, checks it and answers with the cart, whose verifiedEmail is then set and which gets the company's prices and terms for that email. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The cart's token, from starting the cart.",
            "schema": {
              "type": "string"
            },
            "example": "c_Q2xNw7fjK4pLm9Rt"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string",
                    "description": "The 6-digit code from the email."
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "email": "kari.nordmann@northwilds.com",
                "code": "482913"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent, or the cart once the code is right.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "sent": {
                              "const": true
                            }
                          },
                          "required": [
                            "sent"
                          ]
                        },
                        {
                          "$ref": "#/components/schemas/Cart"
                        }
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "token": "c_Q2xNw7fjK4pLm9Rt",
                    "currency": "NOK",
                    "currencies": [
                      "NOK",
                      "EUR"
                    ],
                    "locale": "nb",
                    "lines": [
                      {
                        "variantId": "6650f1c2a9e4b1d2c3f41101",
                        "productId": "6650f1c2a9e4b1d2c3f41001",
                        "slug": "fjellvind-down-jacket",
                        "title": "Fjellvind down jacket",
                        "variantTitle": "M",
                        "sku": "NW-FJV-M",
                        "image": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp",
                        "quantity": 1,
                        "unitPrice": 349900,
                        "listPrice": 349900,
                        "total": 349900,
                        "available": 12,
                        "problem": null,
                        "priceSource": "shop",
                        "branches": null,
                        "quantityRule": null,
                        "volumePercent": 0,
                        "giftCard": false,
                        "planId": null,
                        "planName": null,
                        "digital": false
                      },
                      {
                        "variantId": "6650f1c2a9e4b1d2c3f41201",
                        "productId": "6650f1c2a9e4b1d2c3f41002",
                        "slug": "stig-trekking-poles",
                        "title": "Stig trekking poles",
                        "variantTitle": null,
                        "sku": "NW-STIG",
                        "image": "https://media.northwilds.com/gear/stig-trekking-poles.webp",
                        "quantity": 1,
                        "unitPrice": 89900,
                        "listPrice": 89900,
                        "total": 89900,
                        "available": 30,
                        "problem": null,
                        "priceSource": "shop",
                        "branches": null,
                        "quantityRule": null,
                        "volumePercent": 0,
                        "giftCard": false,
                        "planId": null,
                        "planName": null,
                        "digital": false
                      }
                    ],
                    "count": 2,
                    "email": "kari.nordmann@northwilds.com",
                    "name": "Kari Nordmann",
                    "phone": "+47 912 34 567",
                    "vatNumber": null,
                    "company": null,
                    "discountCode": null,
                    "discountProblem": null,
                    "shippingAddress": {
                      "name": "Kari Nordmann",
                      "company": null,
                      "line1": "Storgata 12",
                      "line2": null,
                      "postalCode": "0155",
                      "city": "Oslo",
                      "region": null,
                      "country": "NO",
                      "phone": "+47 912 34 567"
                    },
                    "billingAddress": null,
                    "vat": null,
                    "salesTax": null,
                    "verifiedEmail": "kari.nordmann@northwilds.com",
                    "country": "NO",
                    "shipping": {
                      "kind": "rate",
                      "rateId": "posten-home"
                    },
                    "shippingChoices": [
                      {
                        "kind": "rate",
                        "id": "posten-home",
                        "name": "Posten, delivered home",
                        "price": 9900,
                        "free": false,
                        "minDays": 2,
                        "maxDays": 4,
                        "servicePoint": false
                      },
                      {
                        "kind": "pickup",
                        "id": "oslo-shop",
                        "name": "Collect from the Oslo shop",
                        "price": 0,
                        "free": true,
                        "minDays": 0,
                        "maxDays": 1
                      }
                    ],
                    "totals": {
                      "subtotal": 438800,
                      "discountTotal": 0,
                      "shippingTotal": 9900,
                      "taxTotal": 89740,
                      "total": 448700,
                      "tax": {
                        "mode": "domestic",
                        "country": "NO",
                        "pricesIncludeTax": true,
                        "lines": [
                          {
                            "rate": 25,
                            "base": 358960,
                            "tax": 89740
                          }
                        ]
                      },
                      "discount": null,
                      "discounts": [],
                      "giftCardTotal": 0,
                      "amountDue": 448700
                    },
                    "offers": [],
                    "giftCards": [],
                    "giftCardProblems": [],
                    "giftCardCodes": [],
                    "badGiftCards": [],
                    "prices": "list",
                    "customer": null,
                    "account": null,
                    "pricesCheckedAt": null,
                    "problems": [],
                    "orderId": null,
                    "needsShipping": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "No email, or a wrong or expired code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "That code isn't right. Check the email and try again."
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No cart with that token. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Cart was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "Sending: more than 1 code a minute for this cart, after a first 5. Checking: more than 2 tries a minute, after a first 10.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It emails a real code."
        }
      }
    },
    "/{shop}/carts/{token}/service-points": {
      "get": {
        "operationId": "listServicePoints",
        "tags": [
          "Carts"
        ],
        "summary": "Service points near the address",
        "description": "For a shipping choice with servicePoint true: the carrier's service points near the cart's address, to pass as shipping.servicePoint. Empty for a rate without service points. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "description": "The cart's token, from starting the cart.",
            "schema": {
              "type": "string"
            },
            "example": "c_Q2xNw7fjK4pLm9Rt"
          },
          {
            "name": "rate",
            "in": "query",
            "required": true,
            "description": "The shipping choice's id.",
            "schema": {
              "type": "string"
            },
            "example": "posten-pickup-point"
          }
        ],
        "responses": {
          "200": {
            "description": "The service points.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "points": {
                          "type": "array",
                          "items": {
                            "$ref": "#/components/schemas/ServicePoint"
                          }
                        }
                      },
                      "required": [
                        "points"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "points": [
                      {
                        "id": "122045",
                        "name": "Coop Mega Storgata",
                        "address": "Storgata 25, 0184 Oslo",
                        "carrier": "Posten"
                      },
                      {
                        "id": "122187",
                        "name": "Narvesen Oslo S",
                        "address": "Jernbanetorget 1, 0154 Oslo",
                        "carrier": "Posten"
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No cart with that token. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Cart was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this cart.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a real cart, from one of the shop's own websites."
        }
      }
    },
    "/{shop}/orders/{reference}": {
      "get": {
        "operationId": "getOrder",
        "tags": [
          "Orders"
        ],
        "summary": "Get an order",
        "description": "The order for a thank-you or order page. If a card payment is still waiting, Commerce Orbit asks Stripe first, so the answer is current when the shopper comes back from paying. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "description": "The order number.",
            "schema": {
              "type": "string"
            },
            "example": "NW1042"
          },
          {
            "name": "email",
            "in": "query",
            "required": true,
            "description": "The email the order was placed with. Any other gets 404.",
            "schema": {
              "type": "string",
              "format": "email"
            },
            "example": "kari.nordmann@northwilds.com"
          }
        ],
        "responses": {
          "200": {
            "description": "The order.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Order"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "reference": "NW1042",
                    "status": "open",
                    "paymentStatus": "paid",
                    "fulfilment": "fulfilled",
                    "placedAt": "2026-11-02T09:30:00.000Z",
                    "currency": "NOK",
                    "lines": [
                      {
                        "title": "Fjellvind down jacket",
                        "variantTitle": "M",
                        "quantity": 1,
                        "total": 349900,
                        "image": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp"
                      },
                      {
                        "title": "Stig trekking poles",
                        "variantTitle": null,
                        "quantity": 1,
                        "total": 89900,
                        "image": "https://media.northwilds.com/gear/stig-trekking-poles.webp"
                      }
                    ],
                    "subtotal": 438800,
                    "discountTotal": 0,
                    "shippingTotal": 9900,
                    "taxTotal": 89740,
                    "total": 448700,
                    "pricesIncludeTax": true,
                    "taxMode": "domestic",
                    "shipping": "Posten, delivered home",
                    "tracking": [
                      {
                        "carrier": "Posten",
                        "number": "70712345678901234",
                        "url": "https://sporing.posten.no/sporing/70712345678901234"
                      }
                    ],
                    "email": "kari.nordmann@northwilds.com",
                    "downloads": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "No email.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Add the email address the order was placed with"
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No order with that number and email. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Order was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a real order and the email it was placed with."
        }
      }
    },
    "/{shop}/orders/{reference}/pdf": {
      "get": {
        "operationId": "getOrderPdf",
        "tags": [
          "Orders"
        ],
        "summary": "Download the receipt",
        "description": "The receipt, or the invoice for an order on invoice, once it is paid or placed. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "description": "The order number.",
            "schema": {
              "type": "string"
            },
            "example": "NW1042"
          },
          {
            "name": "email",
            "in": "query",
            "required": true,
            "description": "The email the order was placed with. Any other gets 404.",
            "schema": {
              "type": "string",
              "format": "email"
            },
            "example": "kari.nordmann@northwilds.com"
          }
        ],
        "responses": {
          "200": {
            "description": "The PDF, as an attachment.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "400": {
            "description": "No email.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Add the email address the order was placed with"
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No order with that number and email. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Order was not found"
                  }
                }
              }
            }
          },
          "409": {
            "description": "The order isn't paid yet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "conflict",
                    "message": "The receipt is ready once the payment has gone through"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a real order and the email it was placed with."
        }
      }
    },
    "/{shop}/returns": {
      "get": {
        "operationId": "getReturnOptions",
        "tags": [
          "Returns"
        ],
        "summary": "What can be returned",
        "description": "What can be returned from an order, and the returns already asked for. For a signed-in customer, leave out email and send the customer token. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "reference",
            "in": "query",
            "required": true,
            "description": "The order number.",
            "schema": {
              "type": "string"
            },
            "example": "NW1042"
          },
          {
            "name": "email",
            "in": "query",
            "required": false,
            "description": "The email the order was placed with. Leave out with a customer token.",
            "schema": {
              "type": "string",
              "format": "email"
            },
            "example": "kari.nordmann@northwilds.com"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "A signed-in customer's token. Answers then carry that customer's prices and stock, and are never cached.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "What can come back.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/ReturnOptions"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "orderReference": "NW1042",
                    "open": true,
                    "until": "2026-12-05T09:30:00.000Z",
                    "reason": null,
                    "closed": null,
                    "lines": [
                      {
                        "lineId": "l1",
                        "title": "Fjellvind down jacket",
                        "variantTitle": "M",
                        "image": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp",
                        "left": 1
                      },
                      {
                        "lineId": "l2",
                        "title": "Stig trekking poles",
                        "variantTitle": null,
                        "image": "https://media.northwilds.com/gear/stig-trekking-poles.webp",
                        "left": 1
                      }
                    ],
                    "returns": []
                  }
                }
              }
            }
          },
          "400": {
            "description": "No order number or email.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Add the order number and the email address the order was placed with"
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No order with that number and email. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Order was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a real order and the email it was placed with."
        }
      },
      "post": {
        "operationId": "requestReturn",
        "tags": [
          "Returns"
        ],
        "summary": "Ask for a return",
        "description": "The shop's team gets a notification and the customer an email. With a customer token, email can be left out. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "A signed-in customer's token. Answers then carry that customer's prices and stock, and are never cached.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReturnRequest"
              },
              "example": {
                "reference": "NW1042",
                "email": "kari.nordmann@northwilds.com",
                "lines": [
                  {
                    "lineId": "l1",
                    "quantity": 1,
                    "reason": "tooSmall"
                  }
                ],
                "note": "The jacket is a little tight across the shoulders."
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The return.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Return"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "reference": "R1001",
                    "orderReference": "NW1042",
                    "status": "requested",
                    "lines": [
                      {
                        "title": "Fjellvind down jacket",
                        "variantTitle": "M",
                        "quantity": 1,
                        "reason": "tooSmall",
                        "received": 0
                      }
                    ],
                    "note": "The jacket is a little tight across the shoulders.",
                    "decisionNote": null,
                    "label": null,
                    "refundAmount": null,
                    "currency": "NOK",
                    "createdAt": "2026-11-06T14:12:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "A line that isn't on the order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "That item isn't on the order"
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No order with that number and email. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Order was not found"
                  }
                }
              }
            }
          },
          "409": {
            "description": "The return window has closed, or nothing on the order can come back.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "conflict",
                    "message": "Returns for this order closed on 2026-12-05"
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field that isn't valid, with issues.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Enter a valid email address",
                    "issues": [
                      {
                        "code": "invalid_format",
                        "format": "email",
                        "path": [
                          "email"
                        ],
                        "message": "Enter a valid email address"
                      }
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 5 a minute from one network for this order, after a first 10.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It asks for a real return and emails the customer."
        }
      }
    },
    "/{shop}/returns/{reference}": {
      "get": {
        "operationId": "getReturn",
        "tags": [
          "Returns"
        ],
        "summary": "Get a return",
        "description": "A return, by its number. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "reference",
            "in": "path",
            "required": true,
            "description": "The return number.",
            "schema": {
              "type": "string"
            },
            "example": "R1001"
          },
          {
            "name": "email",
            "in": "query",
            "required": true,
            "description": "The email the order was placed with. Any other gets 404.",
            "schema": {
              "type": "string",
              "format": "email"
            },
            "example": "kari.nordmann@northwilds.com"
          }
        ],
        "responses": {
          "200": {
            "description": "The return.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Return"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "reference": "R1001",
                    "orderReference": "NW1042",
                    "status": "approved",
                    "lines": [
                      {
                        "title": "Fjellvind down jacket",
                        "variantTitle": "M",
                        "quantity": 1,
                        "reason": "tooSmall",
                        "received": 0
                      }
                    ],
                    "note": "The jacket is a little tight across the shoulders.",
                    "decisionNote": "Thanks, Kari. Drop it off at any post office with the label.",
                    "label": {
                      "carrier": "Posten",
                      "trackingNumber": "70798765432109876",
                      "trackingUrl": "https://sporing.posten.no/sporing/70798765432109876",
                      "labelUrl": "https://media.northwilds.com/returns/R1001-label.pdf"
                    },
                    "refundAmount": null,
                    "currency": "NOK",
                    "createdAt": "2026-11-06T14:12:00.000Z"
                  }
                }
              }
            }
          },
          "400": {
            "description": "No email.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Add the email address the order was placed with"
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No return with that number and email. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Return was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this return.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a real return and its email."
        }
      }
    },
    "/{shop}/gift-cards": {
      "post": {
        "operationId": "giftCardBalance",
        "tags": [
          "Gift cards"
        ],
        "summary": "Check a gift card's balance",
        "description": "Allows 2 tries a minute from one network, after a first 10. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "description": "The code. Spaces, hyphens and small letters don't matter."
                  }
                },
                "required": [
                  "code"
                ]
              },
              "example": {
                "code": "7KQ2-MNB4-XW8P-3HTR"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The balance.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/GiftCardBalance"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "last4": "3HTR",
                    "balance": 50000,
                    "currency": "NOK",
                    "expiresAt": "2027-12-31T23:00:00.000Z",
                    "usable": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "No code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Enter the gift card code"
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No gift card with that code. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Gift card was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 2 tries a minute from one network, after a first 10.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a real gift card code."
        }
      }
    },
    "/{shop}/customer/code": {
      "post": {
        "operationId": "sendCustomerCode",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Send a sign-in code",
        "description": "Emails a 6-digit code that works for 10 minutes. It always answers { sent: true }, so it never tells anyone whether an address has an account. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "locale": {
                    "type": "string",
                    "description": "The language of the email."
                  }
                },
                "required": [
                  "email"
                ]
              },
              "example": {
                "email": "kari.nordmann@northwilds.com",
                "locale": "nb"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Sent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "sent": {
                          "const": true
                        }
                      },
                      "required": [
                        "sent"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "sent": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Not an email address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Enter a valid email address",
                    "issues": [
                      {
                        "code": "invalid_format",
                        "format": "email",
                        "path": [
                          "email"
                        ],
                        "message": "Enter a valid email address"
                      }
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 1 code a minute from one network, or for one email, after a first 5.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It emails a real code."
        }
      }
    },
    "/{shop}/customer/session": {
      "post": {
        "operationId": "signIn",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Sign a customer in",
        "description": "Swaps the email and code for a customer token that lasts 30 days, and makes the account the first time. name is only used for a new account. cart moves that cart over to the customer. Five wrong codes end the code. Keep the token like a password and send it back in X-Customer-Token. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "email": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string",
                    "description": "For a new account."
                  },
                  "cart": {
                    "type": "string",
                    "description": "A cart token to move to the customer."
                  }
                },
                "required": [
                  "email",
                  "code"
                ]
              },
              "example": {
                "email": "kari.nordmann@northwilds.com",
                "code": "482913",
                "name": "Kari Nordmann",
                "cart": "c_Q2xNw7fjK4pLm9Rt"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signed in.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "token": {
                          "type": "string",
                          "description": "The customer token, such as cst_…."
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "created": {
                          "type": "boolean",
                          "description": "A new account."
                        },
                        "customer": {
                          "$ref": "#/components/schemas/Customer"
                        }
                      },
                      "required": [
                        "token",
                        "expiresAt",
                        "created",
                        "customer"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "token": "cst_…",
                    "expiresAt": "2026-12-02T09:30:00.000Z",
                    "created": false,
                    "customer": {
                      "email": "kari.nordmann@northwilds.com",
                      "name": "Kari Nordmann",
                      "company": null,
                      "account": null,
                      "pendingRequest": null,
                      "priceList": null,
                      "phone": "+47 912 34 567",
                      "marketing": true,
                      "addresses": [
                        {
                          "id": "a1",
                          "name": "Kari Nordmann",
                          "company": null,
                          "line1": "Storgata 12",
                          "line2": null,
                          "postalCode": "0155",
                          "city": "Oslo",
                          "region": null,
                          "country": "NO",
                          "phone": "+47 912 34 567",
                          "defaultShipping": true,
                          "defaultBilling": true
                        }
                      ],
                      "deletionRequestedAt": null
                    }
                  }
                }
              }
            }
          },
          "201": {
            "description": "Signed in to a new account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "token": {
                          "type": "string"
                        },
                        "expiresAt": {
                          "type": "string",
                          "format": "date-time"
                        },
                        "created": {
                          "type": "boolean"
                        },
                        "customer": {
                          "$ref": "#/components/schemas/Customer"
                        }
                      },
                      "required": [
                        "token",
                        "expiresAt",
                        "created",
                        "customer"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "token": "cst_…",
                    "expiresAt": "2026-12-02T09:30:00.000Z",
                    "created": true,
                    "customer": {
                      "email": "kari.nordmann@northwilds.com",
                      "name": "Kari Nordmann",
                      "company": null,
                      "account": null,
                      "pendingRequest": null,
                      "priceList": null,
                      "phone": null,
                      "marketing": false,
                      "addresses": [],
                      "deletionRequestedAt": null
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A wrong or expired code.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "That code has expired. Send a new one."
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "Not an email address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Enter a valid email address",
                    "issues": [
                      {
                        "code": "invalid_format",
                        "format": "email",
                        "path": [
                          "email"
                        ],
                        "message": "Enter a valid email address"
                      }
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 2 tries a minute from one network, after a first 10.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a code from a real inbox."
        }
      },
      "delete": {
        "operationId": "signOut",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Sign out",
        "description": "Ends the customer token. cart takes the customer's prices off that cart too. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          },
          {
            "name": "cart",
            "in": "query",
            "description": "A cart token.",
            "schema": {
              "type": "string"
            },
            "example": "c_Q2xNw7fjK4pLm9Rt"
          }
        ],
        "responses": {
          "200": {
            "description": "Signed out.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "signedOut": {
                          "const": true
                        }
                      },
                      "required": [
                        "signedOut"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "signedOut": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "A key that is wrong, revoked or expired, or a customer token that isn't valid or has expired.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "This API key isn't valid for this organisation. Check it under API keys in Commerce Orbit."
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It changes data, so it is described here and not run from the docs."
        }
      }
    },
    "/{shop}/customer": {
      "get": {
        "operationId": "getCustomer",
        "tags": [
          "Customer accounts"
        ],
        "summary": "The signed-in customer",
        "description": "The customer for a token. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "responses": {
          "200": {
            "description": "The customer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "email": "kari.nordmann@northwilds.com",
                    "name": "Kari Nordmann",
                    "company": null,
                    "account": null,
                    "pendingRequest": null,
                    "priceList": null,
                    "phone": "+47 912 34 567",
                    "marketing": true,
                    "addresses": [
                      {
                        "id": "a1",
                        "name": "Kari Nordmann",
                        "company": null,
                        "line1": "Storgata 12",
                        "line2": null,
                        "postalCode": "0155",
                        "city": "Oslo",
                        "region": null,
                        "country": "NO",
                        "phone": "+47 912 34 567",
                        "defaultShipping": true,
                        "defaultBilling": true
                      }
                    ],
                    "deletionRequestedAt": null
                  }
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a signed-in customer."
        }
      },
      "patch": {
        "operationId": "updateCustomer",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Change the customer's details",
        "description": "Send only what changes. The email can't be changed, as it is the sign-in. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "maxLength": 120
                  },
                  "phone": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "maxLength": 40
                  },
                  "marketing": {
                    "type": "boolean",
                    "description": "Agrees to marketing email."
                  }
                },
                "required": []
              },
              "example": {
                "name": "Kari Nordmann",
                "phone": "+47 912 34 567",
                "marketing": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The customer.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Customer"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "email": "kari.nordmann@northwilds.com",
                    "name": "Kari Nordmann",
                    "company": null,
                    "account": null,
                    "pendingRequest": null,
                    "priceList": null,
                    "phone": "+47 912 34 567",
                    "marketing": true,
                    "addresses": [
                      {
                        "id": "a1",
                        "name": "Kari Nordmann",
                        "company": null,
                        "line1": "Storgata 12",
                        "line2": null,
                        "postalCode": "0155",
                        "city": "Oslo",
                        "region": null,
                        "country": "NO",
                        "phone": "+47 912 34 567",
                        "defaultShipping": true,
                        "defaultBilling": true
                      }
                    ],
                    "deletionRequestedAt": null
                  }
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field that isn't valid, with issues.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Add your name",
                    "issues": [
                      {
                        "code": "too_small",
                        "minimum": 1,
                        "origin": "string",
                        "path": [
                          "name"
                        ],
                        "message": "Add your name"
                      }
                    ]
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It changes data, so it is described here and not run from the docs."
        }
      }
    },
    "/{shop}/customer/orders": {
      "get": {
        "operationId": "listCustomerOrders",
        "tags": [
          "Customer accounts"
        ],
        "summary": "The customer's orders",
        "description": "Newest first. There are no pages: ask for up to 100 with limit. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          },
          {
            "name": "limit",
            "in": "query",
            "description": "20 unless you say, up to 100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            },
            "example": 20
          }
        ],
        "responses": {
          "200": {
            "description": "The orders.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccountOrder"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "reference": "NW1042",
                      "status": "open",
                      "paymentStatus": "paid",
                      "fulfilment": "fulfilled",
                      "placedAt": "2026-11-02T09:30:00.000Z",
                      "currency": "NOK",
                      "lines": [
                        {
                          "title": "Fjellvind down jacket",
                          "variantTitle": "M",
                          "quantity": 1,
                          "total": 349900,
                          "image": "https://media.northwilds.com/gear/fjellvind-down-jacket.webp"
                        },
                        {
                          "title": "Stig trekking poles",
                          "variantTitle": null,
                          "quantity": 1,
                          "total": 89900,
                          "image": "https://media.northwilds.com/gear/stig-trekking-poles.webp"
                        }
                      ],
                      "subtotal": 438800,
                      "discountTotal": 0,
                      "shippingTotal": 9900,
                      "taxTotal": 89740,
                      "total": 448700,
                      "pricesIncludeTax": true,
                      "taxMode": "domestic",
                      "shipping": "Posten, delivered home",
                      "tracking": [
                        {
                          "carrier": "Posten",
                          "number": "70712345678901234",
                          "url": "https://sporing.posten.no/sporing/70712345678901234"
                        }
                      ],
                      "email": "kari.nordmann@northwilds.com",
                      "reorder": [
                        {
                          "productId": "6650f1c2a9e4b1d2c3f41001",
                          "variantId": "6650f1c2a9e4b1d2c3f41101",
                          "quantity": 1
                        },
                        {
                          "productId": "6650f1c2a9e4b1d2c3f41002",
                          "variantId": "6650f1c2a9e4b1d2c3f41201",
                          "quantity": 1
                        }
                      ],
                      "receipt": true,
                      "invoiceNumber": null
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a signed-in customer."
        }
      }
    },
    "/{shop}/customer/addresses": {
      "get": {
        "operationId": "listAddresses",
        "tags": [
          "Customer accounts"
        ],
        "summary": "The address book",
        "description": "Up to 20 addresses. Addresses the customer orders with are added by themselves. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "responses": {
          "200": {
            "description": "The address book.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SavedAddress"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "a1",
                      "name": "Kari Nordmann",
                      "company": null,
                      "line1": "Storgata 12",
                      "line2": null,
                      "postalCode": "0155",
                      "city": "Oslo",
                      "region": null,
                      "country": "NO",
                      "phone": "+47 912 34 567",
                      "defaultShipping": true,
                      "defaultBilling": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a signed-in customer."
        }
      },
      "post": {
        "operationId": "addAddress",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Add an address",
        "description": "Answers with the whole book. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddressInput"
              },
              "example": {
                "name": "Kari Nordmann",
                "company": "Northwilds",
                "line1": "Karl Johans gate 22",
                "line2": null,
                "postalCode": "0159",
                "city": "Oslo",
                "region": null,
                "country": "NO",
                "phone": null,
                "defaultBilling": true
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The address book.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SavedAddress"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "a1",
                      "name": "Kari Nordmann",
                      "company": null,
                      "line1": "Storgata 12",
                      "line2": null,
                      "postalCode": "0155",
                      "city": "Oslo",
                      "region": null,
                      "country": "NO",
                      "phone": "+47 912 34 567",
                      "defaultShipping": true,
                      "defaultBilling": false
                    },
                    {
                      "id": "a2",
                      "name": "Kari Nordmann",
                      "company": "Northwilds",
                      "line1": "Karl Johans gate 22",
                      "line2": null,
                      "postalCode": "0159",
                      "city": "Oslo",
                      "region": null,
                      "country": "NO",
                      "phone": null,
                      "defaultShipping": false,
                      "defaultBilling": true
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "The book already has 20 addresses.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "An account can keep up to 20 addresses. Remove one first."
                  }
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field that isn't valid, with issues.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Check the details and try again"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It changes data, so it is described here and not run from the docs."
        }
      }
    },
    "/{shop}/customer/addresses/{addressId}": {
      "patch": {
        "operationId": "updateAddress",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Change an address",
        "description": "Send only what changes, including defaultShipping and defaultBilling. Answers with the whole book. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "The address's id.",
            "schema": {
              "type": "string"
            },
            "example": "a1"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "company": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "line2": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 160
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20
                  },
                  "city": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "region": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 80
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                  },
                  "phone": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "defaultShipping": {
                    "type": "boolean"
                  },
                  "defaultBilling": {
                    "type": "boolean"
                  }
                },
                "required": [],
                "description": "Any of the address fields."
              },
              "example": {
                "line1": "Storgata 14",
                "phone": "+47 912 34 567"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The address book.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SavedAddress"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "a1",
                      "name": "Kari Nordmann",
                      "company": null,
                      "line1": "Storgata 14",
                      "line2": null,
                      "postalCode": "0155",
                      "city": "Oslo",
                      "region": null,
                      "country": "NO",
                      "phone": "+47 912 34 567",
                      "defaultShipping": true,
                      "defaultBilling": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such address. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Address was not found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "A field that isn't valid, with issues.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Check the details and try again"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It changes data, so it is described here and not run from the docs."
        }
      },
      "delete": {
        "operationId": "removeAddress",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Remove an address",
        "description": "Answers with the whole book. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "addressId",
            "in": "path",
            "required": true,
            "description": "The address's id.",
            "schema": {
              "type": "string"
            },
            "example": "a1"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "responses": {
          "200": {
            "description": "The address book.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/SavedAddress"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": []
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such address. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Address was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 20 a minute from one network for this customer.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It changes data, so it is described here and not run from the docs."
        }
      }
    },
    "/{shop}/customer/subscriptions": {
      "get": {
        "operationId": "listSubscriptions",
        "tags": [
          "Customer accounts"
        ],
        "summary": "The customer's subscriptions",
        "description": "Newest first, up to 500. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "responses": {
          "200": {
            "description": "The subscriptions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Subscription"
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "id": "6650f1c2a9e4b1d2c3f44001",
                      "email": "kari.nordmann@northwilds.com",
                      "name": "Kari Nordmann",
                      "status": "active",
                      "every": "Every month",
                      "amount": 14900,
                      "currency": "NOK",
                      "lines": [
                        {
                          "title": "Trail coffee, 500 g",
                          "variantTitle": null,
                          "quantity": 1
                        }
                      ],
                      "nextAt": "2026-12-02T09:30:00.000Z",
                      "orders": 3,
                      "createdAt": "2026-08-02T09:30:00.000Z"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a signed-in customer."
        }
      }
    },
    "/{shop}/customer/subscriptions/{subscriptionId}": {
      "delete": {
        "operationId": "cancelSubscription",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Cancel a subscription",
        "description": "Cancels at the end of the period paid for, and answers with it. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "subscriptionId",
            "in": "path",
            "required": true,
            "description": "The subscription's id.",
            "schema": {
              "type": "string"
            },
            "example": "6650f1c2a9e4b1d2c3f44001"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "responses": {
          "200": {
            "description": "The subscription, now cancelling.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/Subscription"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "id": "6650f1c2a9e4b1d2c3f44001",
                    "email": "kari.nordmann@northwilds.com",
                    "name": "Kari Nordmann",
                    "status": "cancelling",
                    "every": "Every month",
                    "amount": 14900,
                    "currency": "NOK",
                    "lines": [
                      {
                        "title": "Trail coffee, 500 g",
                        "variantTitle": null,
                        "quantity": 1
                      }
                    ],
                    "nextAt": "2026-12-02T09:30:00.000Z",
                    "orders": 3,
                    "createdAt": "2026-08-02T09:30:00.000Z"
                  }
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not the customer's subscription. Or no shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Subscription was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It changes data, so it is described here and not run from the docs."
        }
      }
    },
    "/{shop}/customer/downloads": {
      "get": {
        "operationId": "listCustomerDownloads",
        "tags": [
          "Customer accounts"
        ],
        "summary": "The customer's downloads",
        "description": "Files the customer bought, newest order first. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "responses": {
          "200": {
            "description": "The downloads.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "reference": {
                            "type": "string",
                            "description": "The order number."
                          },
                          "grantId": {
                            "type": "string"
                          },
                          "lineId": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "filename": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer",
                            "description": "Bytes."
                          },
                          "url": {
                            "type": "string",
                            "description": "Works for 7 days. Read again for a fresh one."
                          },
                          "downloads": {
                            "type": "integer",
                            "description": "Used."
                          },
                          "limit": {
                            "type": [
                              "integer",
                              "null"
                            ]
                          },
                          "expiresAt": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "date-time"
                          },
                          "usable": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "reference",
                          "grantId",
                          "lineId",
                          "title",
                          "filename",
                          "size",
                          "url",
                          "downloads",
                          "limit",
                          "expiresAt",
                          "usable"
                        ]
                      }
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": [
                    {
                      "reference": "NW1042",
                      "grantId": "6650f1c2a9e4b1d2c3f43001",
                      "lineId": "l3",
                      "title": "Lofoten hiking map",
                      "filename": "lofoten-hiking-map.pdf",
                      "size": 4812733,
                      "url": "https://app.bifrostorbit.com/commerce/api/public/northwilds/downloads/6650f1c2a9e4b1d2c3f43001?until=20768&signature=…",
                      "downloads": 1,
                      "limit": 5,
                      "expiresAt": null,
                      "usable": true
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a signed-in customer."
        }
      }
    },
    "/{shop}/customer/link-request": {
      "post": {
        "operationId": "requestAccountLink",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Ask to link a MAM account",
        "description": "Asks the shop's team to link an account. Nothing changes for the customer until someone in the team approves it. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "accountNumber": {
                    "type": "string"
                  },
                  "note": {
                    "type": "string"
                  }
                },
                "required": [
                  "accountNumber"
                ]
              },
              "example": {
                "accountNumber": "NW1002",
                "note": "I buy for Turlaget Nord"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Asked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "requested": {
                          "const": true
                        }
                      },
                      "required": [
                        "requested"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "requested": true
                  }
                }
              }
            }
          },
          "400": {
            "description": "The account is already linked to that number.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Your account is already linked to that number"
                  }
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "422": {
            "description": "An account number that isn't valid, with issues.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "invalid",
                    "message": "Check the details and try again"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 1 a minute from one network for this customer, after a first 5.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It changes data, so it is described here and not run from the docs."
        }
      }
    },
    "/{shop}/customer/deletion": {
      "post": {
        "operationId": "requestDeletion",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Ask to delete the account",
        "description": "The team gets a notification and closes the account; the orders stay for their accounts. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          }
        ],
        "responses": {
          "200": {
            "description": "Asked.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "object",
                      "properties": {
                        "requested": {
                          "const": true
                        }
                      },
                      "required": [
                        "requested"
                      ]
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "requested": true
                  }
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 1 a minute from one network for this customer, after a first 5.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It changes data, so it is described here and not run from the docs."
        }
      }
    },
    "/{shop}/prices": {
      "get": {
        "operationId": "getPersonalPrices",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Personal prices",
        "description": "The signed-in customer's prices for products you already show, to lay over a cached page. 30 calls a minute for each customer and network. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          },
          {
            "name": "ids",
            "in": "query",
            "description": "Up to 100 product ids, separated by commas.",
            "schema": {
              "type": "string"
            },
            "example": "6650f1c2a9e4b1d2c3f41001,6650f1c2a9e4b1d2c3f41003"
          },
          {
            "name": "slugs",
            "in": "query",
            "description": "Up to 100 product addresses, separated by commas.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "currency",
            "in": "query",
            "description": "A currency, such as NOK. Prices are the shop's own price in it, never a conversion.",
            "schema": {
              "type": "string"
            },
            "example": "NOK"
          },
          {
            "name": "branches",
            "in": "query",
            "description": "yours, or all to add every branch.",
            "schema": {
              "type": "string",
              "enum": [
                "yours",
                "all"
              ]
            }
          },
          {
            "name": "locale",
            "in": "query",
            "description": "A language, such as nb. Without it, or with one the shop doesn't offer, the main language.",
            "schema": {
              "type": "string"
            },
            "example": "nb"
          }
        ],
        "responses": {
          "200": {
            "description": "The prices.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PersonalPrices"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "account": null,
                    "priceList": "Turlaget members",
                    "onStop": false,
                    "checkedAt": null,
                    "products": [
                      {
                        "id": "6650f1c2a9e4b1d2c3f41001",
                        "slug": "fjellvind-down-jacket",
                        "currency": "NOK",
                        "source": "priceList",
                        "price": {
                          "min": 314900,
                          "max": 314900,
                          "currency": "NOK",
                          "compareAt": null
                        },
                        "available": true,
                        "variants": [
                          {
                            "id": "6650f1c2a9e4b1d2c3f41101",
                            "title": "M",
                            "options": [
                              "M"
                            ],
                            "sku": "NW-FJV-M",
                            "price": 314900,
                            "compareAtPrice": null,
                            "available": true,
                            "quantity": 12,
                            "listPrice": 349900,
                            "priceSource": "priceList",
                            "branches": null,
                            "volume": [],
                            "quantityRule": null,
                            "requiresShipping": true,
                            "digital": false,
                            "plans": [],
                            "metafields": {}
                          }
                        ]
                      },
                      {
                        "id": "6650f1c2a9e4b1d2c3f41003",
                        "slug": "tind-40-pack",
                        "currency": "NOK",
                        "source": "priceList",
                        "price": {
                          "min": 179900,
                          "max": 179900,
                          "currency": "NOK",
                          "compareAt": null
                        },
                        "available": true,
                        "variants": [
                          {
                            "id": "6650f1c2a9e4b1d2c3f41301",
                            "title": "Default",
                            "options": [],
                            "sku": "NW-TIND40",
                            "price": 179900,
                            "compareAtPrice": null,
                            "available": true,
                            "quantity": 8,
                            "listPrice": 199900,
                            "priceSource": "priceList",
                            "branches": null,
                            "volume": [],
                            "quantityRule": null,
                            "requiresShipping": true,
                            "digital": false,
                            "plans": [],
                            "metafields": {}
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 30 a minute for this customer from one network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a signed-in customer."
        }
      },
      "post": {
        "operationId": "postPersonalPrices",
        "tags": [
          "Customer accounts"
        ],
        "summary": "Personal prices, in a body",
        "description": "The same as the GET, for long lists. Only the shop's Website and Allowed websites in Settings, the hosted shop, and servers can call it.",
        "parameters": [
          {
            "name": "shop",
            "in": "path",
            "required": true,
            "description": "The shop address from Settings, such as northwilds.",
            "schema": {
              "type": "string"
            },
            "example": "northwilds"
          },
          {
            "name": "X-Customer-Token",
            "in": "header",
            "description": "The signed-in customer's token, from the session endpoint.",
            "schema": {
              "type": "string"
            },
            "required": true,
            "example": "cst_…"
          },
          {
            "name": "locale",
            "in": "query",
            "description": "A language, such as nb. Without it, or with one the shop doesn't offer, the main language.",
            "schema": {
              "type": "string"
            },
            "example": "nb"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "productIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 100
                  },
                  "slugs": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 100
                  },
                  "currency": {
                    "type": "string"
                  },
                  "branches": {
                    "type": "string",
                    "enum": [
                      "yours",
                      "all"
                    ]
                  }
                },
                "required": []
              },
              "example": {
                "productIds": [
                  "6650f1c2a9e4b1d2c3f41001",
                  "6650f1c2a9e4b1d2c3f41003"
                ],
                "currency": "NOK",
                "branches": "yours"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The prices.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/PersonalPrices"
                    }
                  },
                  "required": [
                    "data"
                  ]
                },
                "example": {
                  "data": {
                    "account": null,
                    "priceList": "Turlaget members",
                    "onStop": false,
                    "checkedAt": null,
                    "products": [
                      {
                        "id": "6650f1c2a9e4b1d2c3f41001",
                        "slug": "fjellvind-down-jacket",
                        "currency": "NOK",
                        "source": "priceList",
                        "price": {
                          "min": 314900,
                          "max": 314900,
                          "currency": "NOK",
                          "compareAt": null
                        },
                        "available": true,
                        "variants": [
                          {
                            "id": "6650f1c2a9e4b1d2c3f41101",
                            "title": "M",
                            "options": [
                              "M"
                            ],
                            "sku": "NW-FJV-M",
                            "price": 314900,
                            "compareAtPrice": null,
                            "available": true,
                            "quantity": 12,
                            "listPrice": 349900,
                            "priceSource": "priceList",
                            "branches": null,
                            "volume": [],
                            "quantityRule": null,
                            "requiresShipping": true,
                            "digital": false,
                            "plans": [],
                            "metafields": {}
                          }
                        ]
                      },
                      {
                        "id": "6650f1c2a9e4b1d2c3f41003",
                        "slug": "tind-40-pack",
                        "currency": "NOK",
                        "source": "priceList",
                        "price": {
                          "min": 179900,
                          "max": 179900,
                          "currency": "NOK",
                          "compareAt": null
                        },
                        "available": true,
                        "variants": [
                          {
                            "id": "6650f1c2a9e4b1d2c3f41301",
                            "title": "Default",
                            "options": [],
                            "sku": "NW-TIND40",
                            "price": 179900,
                            "compareAtPrice": null,
                            "available": true,
                            "quantity": 8,
                            "listPrice": 199900,
                            "priceSource": "priceList",
                            "branches": null,
                            "volume": [],
                            "quantityRule": null,
                            "requiresShipping": true,
                            "digital": false,
                            "plans": [],
                            "metafields": {}
                          }
                        ]
                      }
                    ]
                  }
                }
              }
            }
          },
          "401": {
            "description": "No customer token, or one that isn't valid or has expired, or a wrong key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Sign the customer in first, and send their token in the X-Customer-Token header"
                  }
                }
              }
            }
          },
          "402": {
            "description": "The shop is paused because its plan has ended.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "subscription_inactive",
                    "message": "This shop is paused because its Commerce Orbit trial or plan has ended. Nothing is deleted, and it comes back as soon as an owner chooses a plan."
                  }
                }
              }
            }
          },
          "403": {
            "description": "A website that isn't in the shop's allowed websites, or a key that reads drafts sent from a browser.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "forbidden",
                    "message": "This website isn't allowed to use this shop's cart. Add it to the allowed websites in Commerce Orbit's shop settings."
                  }
                }
              }
            }
          },
          "404": {
            "description": "No shop with that address.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "not_found",
                    "message": "Shop was not found"
                  }
                }
              }
            }
          },
          "429": {
            "description": "More than 30 a minute for this customer from one network.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "rate_limited",
                    "message": "Too many tries. Wait a minute and try again."
                  }
                }
              }
            }
          },
          "500": {
            "description": "Something went wrong on our side.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                },
                "example": {
                  "error": {
                    "code": "server_error",
                    "message": "Something went wrong on our side. Try again in a moment."
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "apiKey": []
          },
          {}
        ],
        "x-try-it": {
          "run": false,
          "reason": "It needs a signed-in customer."
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "A stable code, such as not_found, invalid, forbidden, rate_limited or price_changed."
              },
              "message": {
                "type": "string",
                "description": "A message you can show to shoppers as it is."
              },
              "issues": {
                "type": "array",
                "items": {},
                "description": "On 422 only: one entry per field that failed."
              }
            },
            "required": [
              "code",
              "message"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Shop": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "description": "The shop's address, such as northwilds."
          },
          "name": {
            "type": "string",
            "description": "The shop's name."
          },
          "logoUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "The logo."
          },
          "colour": {
            "type": [
              "string",
              "null"
            ],
            "description": "The brand colour, such as #1f2937."
          },
          "currency": {
            "type": "string",
            "description": "The main currency, such as EUR."
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every currency the shop sells in, the main one first."
          },
          "locales": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Every language, the main one first."
          },
          "defaultLocale": {
            "type": "string",
            "description": "The main language, such as en."
          },
          "pricesIncludeTax": {
            "type": "boolean",
            "description": "Whether prices include VAT."
          },
          "shopUrl": {
            "type": "string",
            "description": "The hosted shop."
          },
          "termsUrl": {
            "type": [
              "string",
              "null"
            ],
            "description": "The shop's terms."
          },
          "returnsDays": {
            "type": "integer",
            "description": "Days a shopper has to ask for a return after an order is sent. 0 when returns are by arrangement."
          }
        },
        "required": [
          "slug",
          "name",
          "logoUrl",
          "colour",
          "currency",
          "currencies",
          "locales",
          "defaultLocale",
          "pricesIncludeTax",
          "shopUrl",
          "termsUrl",
          "returnsDays"
        ]
      },
      "Branch": {
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "description": "The MAM branch code."
          },
          "name": {
            "type": "string",
            "description": "The branch name."
          },
          "quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Units in stock there."
          },
          "yours": {
            "type": "boolean",
            "description": "The customer's own branch."
          }
        },
        "required": [
          "code",
          "name",
          "quantity",
          "yours"
        ]
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Pass as planId in a cart line to subscribe."
          },
          "name": {
            "type": "string",
            "description": "Such as Monthly."
          },
          "interval": {
            "type": "string",
            "enum": [
              "week",
              "month",
              "year"
            ]
          },
          "intervalCount": {
            "type": "integer",
            "description": "How many intervals between payments."
          },
          "price": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The price each period, or null without a price in this currency. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          }
        },
        "required": [
          "id",
          "name",
          "interval",
          "intervalCount",
          "price"
        ]
      },
      "QuantityRule": {
        "type": "object",
        "properties": {
          "min": {
            "type": "integer",
            "description": "The fewest in one order."
          },
          "max": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The most in one order."
          },
          "step": {
            "type": "integer",
            "description": "The pack size. Step the quantity picker by it."
          }
        },
        "required": [
          "min",
          "max",
          "step"
        ]
      },
      "Variant": {
        "type": "object",
        "description": "One variant of a product.",
        "properties": {
          "id": {
            "type": "string",
            "description": "The variant's id, for carts."
          },
          "title": {
            "type": "string",
            "description": "Such as 42 / Brown."
          },
          "options": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The option values, in the product's option order."
          },
          "sku": {
            "type": "string"
          },
          "price": {
            "type": [
              "integer",
              "null"
            ],
            "description": "What the shopper pays each, or null when it has no price in this currency and can't be bought in it. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "compareAtPrice": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The price before a sale, only in the main currency. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "available": {
            "type": "boolean",
            "description": "Whether it can be bought."
          },
          "quantity": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Units in stock, or null when stock isn't tracked."
          },
          "listPrice": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The shop's normal price, to show struck through for a signed-in customer. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "priceSource": {
            "type": "string",
            "description": "Where price came from. Not shop only with a customer token.",
            "enum": [
              "shop",
              "priceList",
              "account",
              "loading",
              "unavailable"
            ]
          },
          "branches": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Branch"
            },
            "description": "With a customer token and a MAM account: live stock per branch."
          },
          "volume": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "min": {
                  "type": "integer",
                  "description": "From this many items of the product, across its variants."
                },
                "percent": {
                  "type": "number",
                  "description": "Percent off."
                },
                "price": {
                  "type": "integer",
                  "description": "Each costs this. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                }
              },
              "required": [
                "min",
                "percent",
                "price"
              ]
            },
            "description": "Volume prices. Empty for a price from a MAM account."
          },
          "quantityRule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QuantityRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "requiresShipping": {
            "type": "boolean",
            "description": "Whether it is posted."
          },
          "digital": {
            "type": "boolean",
            "description": "A download, nothing posted."
          },
          "plans": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Plan"
            },
            "description": "Subscription plans."
          },
          "metafields": {
            "type": "object",
            "additionalProperties": {},
            "description": "Custom fields by key, only those the shop shows to websites."
          }
        },
        "required": [
          "id",
          "title",
          "options",
          "sku",
          "price",
          "compareAtPrice",
          "available",
          "quantity",
          "listPrice",
          "priceSource",
          "branches",
          "volume",
          "quantityRule",
          "requiresShipping",
          "digital",
          "plans",
          "metafields"
        ]
      },
      "Product": {
        "type": "object",
        "description": "A product with live prices and stock.",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The product's address, such as fjell-gtx-boot."
          },
          "title": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "description": {
            "type": "string",
            "description": "HTML."
          },
          "vendor": {
            "type": [
              "string",
              "null"
            ]
          },
          "productType": {
            "type": [
              "string",
              "null"
            ]
          },
          "tags": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "description": "Such as Size."
                },
                "values": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                }
              },
              "required": [
                "name",
                "values"
              ]
            }
          },
          "variants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Variant"
            }
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": "string",
                  "description": "Image address."
                },
                "alt": {
                  "type": "string",
                  "description": "Alternative text."
                }
              },
              "required": [
                "url",
                "alt"
              ]
            }
          },
          "specs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "label": {
                  "type": "string"
                },
                "value": {
                  "type": "string"
                }
              },
              "required": [
                "label",
                "value"
              ]
            }
          },
          "price": {
            "type": "object",
            "properties": {
              "min": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The lowest variant price. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "max": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The highest variant price. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "currency": {
                "type": "string"
              },
              "compareAt": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The highest price before a sale. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              }
            },
            "required": [
              "min",
              "max",
              "currency",
              "compareAt"
            ]
          },
          "available": {
            "type": "boolean",
            "description": "Any variant can be bought."
          },
          "status": {
            "type": "string",
            "description": "active, or draft with a key that reads drafts."
          },
          "seo": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "description": "Filled from the title when empty."
              },
              "description": {
                "type": "string",
                "description": "Filled from the summary when empty."
              }
            },
            "required": [
              "title",
              "description"
            ]
          },
          "url": {
            "type": "string",
            "description": "The product on the hosted shop."
          },
          "locale": {
            "type": "string",
            "description": "The language the text is in."
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "stockSyncedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "When stock last came from MAM.",
            "format": "date-time"
          },
          "pricing": {
            "type": "object",
            "description": "With a customer token: where the prices came from.",
            "properties": {
              "source": {
                "type": "string",
                "enum": [
                  "shop",
                  "priceList",
                  "account",
                  "loading",
                  "unavailable"
                ]
              },
              "account": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The MAM account number."
              },
              "checkedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "When MAM answered.",
                "format": "date-time"
              }
            },
            "required": [
              "source",
              "account",
              "checkedAt"
            ]
          },
          "giftCard": {
            "type": "boolean",
            "description": "A gift card. Its code is emailed once the order is paid."
          },
          "metafields": {
            "type": "object",
            "additionalProperties": {},
            "description": "Custom fields by key, only those the shop shows to websites."
          },
          "bundle": {
            "type": [
              "object",
              "null"
            ],
            "description": "A bundle's products. Its quantity is how many whole bundles they make.",
            "properties": {
              "components": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "productId": {
                      "type": "string"
                    },
                    "variantId": {
                      "type": "string"
                    },
                    "quantity": {
                      "type": "integer"
                    }
                  },
                  "required": [
                    "productId",
                    "variantId",
                    "quantity"
                  ]
                }
              }
            },
            "required": [
              "components"
            ]
          }
        },
        "required": [
          "id",
          "slug",
          "title",
          "summary",
          "description",
          "vendor",
          "productType",
          "tags",
          "options",
          "variants",
          "images",
          "specs",
          "price",
          "available",
          "status",
          "seo",
          "url",
          "locale",
          "updatedAt",
          "stockSyncedAt",
          "pricing",
          "giftCard",
          "metafields",
          "bundle"
        ]
      },
      "Collection": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "slug": {
            "type": "string",
            "description": "The collection's address, such as tents."
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "image": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "url": {
                "type": "string",
                "description": "Image address."
              },
              "alt": {
                "type": "string",
                "description": "Alternative text."
              }
            },
            "required": [
              "url",
              "alt"
            ]
          },
          "productCount": {
            "type": "integer",
            "description": "Active products in it."
          },
          "url": {
            "type": "string",
            "description": "The collection on the hosted shop."
          },
          "products": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Product"
            },
            "description": "Only when you read one collection: its products in the collection's order."
          }
        },
        "required": [
          "id",
          "slug",
          "title",
          "description",
          "image",
          "productCount",
          "url"
        ]
      },
      "Address": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "company": {
            "type": [
              "string",
              "null"
            ]
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": [
              "string",
              "null"
            ]
          },
          "postalCode": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": "string",
            "description": "Two letters, such as NO."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "name",
          "company",
          "line1",
          "line2",
          "postalCode",
          "city",
          "region",
          "country",
          "phone"
        ]
      },
      "CartLine": {
        "type": "object",
        "properties": {
          "variantId": {
            "type": "string"
          },
          "productId": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "variantTitle": {
            "type": [
              "string",
              "null"
            ]
          },
          "sku": {
            "type": "string"
          },
          "image": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer"
          },
          "unitPrice": {
            "type": "integer",
            "description": "What the shopper pays each. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "listPrice": {
            "type": "integer",
            "description": "Before a company price or volume price. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "total": {
            "type": "integer",
            "description": "The line total. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "available": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Units left, or null when stock isn't tracked."
          },
          "problem": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why this line can't be bought as it is, such as Only 2 of Tind 2 tent are left."
          },
          "priceSource": {
            "type": "string",
            "enum": [
              "shop",
              "priceList",
              "account",
              "loading",
              "unavailable"
            ]
          },
          "branches": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "$ref": "#/components/schemas/Branch"
            }
          },
          "quantityRule": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/QuantityRule"
              },
              {
                "type": "null"
              }
            ]
          },
          "volumePercent": {
            "type": "number",
            "description": "The volume tier reached, or 0."
          },
          "giftCard": {
            "type": "boolean"
          },
          "planId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The subscription plan, or null."
          },
          "planName": {
            "type": [
              "string",
              "null"
            ]
          },
          "digital": {
            "type": "boolean"
          }
        },
        "required": [
          "variantId",
          "productId",
          "slug",
          "title",
          "variantTitle",
          "sku",
          "image",
          "quantity",
          "unitPrice",
          "listPrice",
          "total",
          "available",
          "problem",
          "priceSource",
          "branches",
          "quantityRule",
          "volumePercent",
          "giftCard",
          "planId",
          "planName",
          "digital"
        ]
      },
      "ShippingChoice": {
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": [
              "rate",
              "pickup"
            ]
          },
          "id": {
            "type": "string",
            "description": "Pass as rateId or locationId in shipping."
          },
          "name": {
            "type": "string"
          },
          "price": {
            "type": [
              "integer",
              "null"
            ],
            "description": "The price, or null before it can be worked out. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "free": {
            "type": "boolean"
          },
          "minDays": {
            "type": [
              "integer",
              "null"
            ]
          },
          "maxDays": {
            "type": [
              "integer",
              "null"
            ]
          },
          "servicePoint": {
            "type": "boolean",
            "description": "The shopper picks a service point for it. See the service points endpoint."
          }
        },
        "required": [
          "kind",
          "id",
          "name",
          "price",
          "free",
          "minDays",
          "maxDays"
        ]
      },
      "Discount": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "null for an automatic offer."
          },
          "title": {
            "type": "string",
            "description": "Show an automatic offer by its title."
          },
          "kind": {
            "type": "string",
            "enum": [
              "percent",
              "fixed",
              "freeShipping",
              "buyXGetY"
            ]
          },
          "automatic": {
            "type": "boolean"
          },
          "amount": {
            "type": "integer",
            "description": "What it takes off. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "freeShipping": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "code",
          "title",
          "kind",
          "automatic",
          "amount",
          "freeShipping"
        ]
      },
      "Tax": {
        "type": "object",
        "properties": {
          "mode": {
            "type": "string",
            "enum": [
              "domestic",
              "oss",
              "reverseCharge",
              "export",
              "salesTax"
            ]
          },
          "country": {
            "type": "string"
          },
          "pricesIncludeTax": {
            "type": "boolean"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "rate": {
                  "type": "number",
                  "description": "Such as 25."
                },
                "base": {
                  "type": "integer",
                  "description": "The amount taxed. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                },
                "tax": {
                  "type": "integer",
                  "description": "The tax. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                },
                "name": {
                  "type": "string",
                  "description": "A sales tax's name."
                }
              },
              "required": [
                "rate",
                "base",
                "tax"
              ]
            },
            "description": "VAT by rate."
          }
        },
        "required": [
          "mode",
          "country",
          "pricesIncludeTax",
          "lines"
        ]
      },
      "Cart": {
        "type": "object",
        "description": "A cart, priced.",
        "properties": {
          "token": {
            "type": "string",
            "description": "The cart's token, such as c_Q2x…. Anyone with it can read and change the cart."
          },
          "currency": {
            "type": "string"
          },
          "currencies": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "locale": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CartLine"
            }
          },
          "count": {
            "type": "integer",
            "description": "Items in the cart."
          },
          "email": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "vatNumber": {
            "type": [
              "string",
              "null"
            ]
          },
          "company": {
            "type": [
              "object",
              "null"
            ],
            "description": "The shopper's company, from their email.",
            "properties": {
              "name": {
                "type": "string"
              },
              "terms": {
                "type": "string",
                "enum": [
                  "card",
                  "invoice"
                ]
              },
              "termsDays": {
                "type": "integer"
              },
              "onStop": {
                "type": "boolean"
              }
            },
            "required": [
              "name",
              "terms",
              "termsDays",
              "onStop"
            ]
          },
          "discountCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "discountProblem": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why the code doesn't apply, such as That code has expired. It doesn't stop checkout."
          },
          "shippingAddress": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "type": "null"
              }
            ]
          },
          "billingAddress": {
            "description": "Without one, the order is billed to the delivery address.",
            "anyOf": [
              {
                "$ref": "#/components/schemas/Address"
              },
              {
                "type": "null"
              }
            ]
          },
          "vat": {
            "type": [
              "object",
              "null"
            ],
            "description": "The VAT number check.",
            "properties": {
              "number": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "valid",
                  "invalid",
                  "unavailable"
                ]
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "The business name VIES has."
              }
            },
            "required": [
              "number",
              "status",
              "name"
            ]
          },
          "salesTax": {
            "type": [
              "string",
              "null"
            ],
            "description": "For a shop that charges US sales tax.",
            "enum": [
              "added",
              "needsAddress",
              null
            ]
          },
          "verifiedEmail": {
            "type": [
              "string",
              "null"
            ],
            "description": "The email confirmed with a code from the verify endpoint."
          },
          "country": {
            "type": "string",
            "description": "For shipping choices and VAT before there is an address."
          },
          "shipping": {
            "description": "The shipping chosen: kind rate with rateId, or kind pickup with locationId.",
            "anyOf": [
              {},
              {
                "type": "null"
              }
            ]
          },
          "shippingChoices": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ShippingChoice"
            }
          },
          "totals": {
            "type": [
              "object",
              "null"
            ],
            "description": "null while the cart can't be priced.",
            "properties": {
              "subtotal": {
                "type": "integer",
                "description": "Before discounts and shipping. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "discountTotal": {
                "type": "integer",
                "description": "Taken off. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "shippingTotal": {
                "type": "integer",
                "description": "Shipping. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "taxTotal": {
                "type": "integer",
                "description": "Tax. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "total": {
                "type": "integer",
                "description": "The order total. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "tax": {
                "$ref": "#/components/schemas/Tax"
              },
              "discount": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "code": {
                    "type": "string"
                  },
                  "amount": {
                    "type": "integer",
                    "description": "Taken off. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                  }
                },
                "required": [
                  "code",
                  "amount"
                ]
              },
              "discounts": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Discount"
                }
              },
              "giftCardTotal": {
                "type": "integer",
                "description": "Paid by gift cards. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "amountDue": {
                "type": "integer",
                "description": "What is left to pay by card. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              }
            },
            "required": [
              "subtotal",
              "discountTotal",
              "shippingTotal",
              "taxTotal",
              "total",
              "tax",
              "discount",
              "discounts",
              "giftCardTotal",
              "amountDue"
            ]
          },
          "offers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Discount"
            },
            "description": "Every discount used."
          },
          "giftCards": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "code": {
                  "type": "string"
                },
                "last4": {
                  "type": "string"
                },
                "amount": {
                  "type": "integer",
                  "description": "What it pays. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                },
                "balance": {
                  "type": "integer",
                  "description": "What stays on it. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                }
              },
              "required": [
                "code",
                "last4",
                "amount",
                "balance"
              ]
            }
          },
          "giftCardProblems": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Why a code can't be used. Stops checkout."
          },
          "giftCardCodes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "badGiftCards": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The codes giftCardProblems names, to remove."
          },
          "prices": {
            "type": "string",
            "description": "list for the shop's or a price list's prices, account when every line has the MAM account's price, fallback when MAM didn't answer for some lines.",
            "enum": [
              "list",
              "account",
              "fallback"
            ]
          },
          "customer": {
            "type": [
              "object",
              "null"
            ],
            "description": "With a customer token.",
            "properties": {
              "name": {
                "type": "string"
              },
              "email": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "email"
            ]
          },
          "account": {
            "type": [
              "object",
              "null"
            ],
            "description": "With a customer token and a MAM account.",
            "properties": {
              "number": {
                "type": "string"
              },
              "onStop": {
                "type": "boolean"
              },
              "creditLimit": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The credit limit. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "balance": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The balance. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "overCredit": {
                "type": "boolean",
                "description": "This order would take the account over its limit."
              },
              "branch": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "number",
              "onStop",
              "creditLimit",
              "balance",
              "overCredit",
              "branch"
            ]
          },
          "pricesCheckedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "When MAM answered.",
            "format": "date-time"
          },
          "problems": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "What stops checkout, such as Gas canister is sold in multiples of 6."
          },
          "orderId": {
            "type": [
              "string",
              "null"
            ],
            "description": "The order once checked out."
          },
          "needsShipping": {
            "type": "boolean",
            "description": "false when every line is a download or a gift card. The cart then needs no shipping choice or address."
          }
        },
        "required": [
          "token",
          "currency",
          "currencies",
          "locale",
          "lines",
          "count",
          "email",
          "name",
          "phone",
          "vatNumber",
          "company",
          "discountCode",
          "discountProblem",
          "shippingAddress",
          "billingAddress",
          "vat",
          "salesTax",
          "verifiedEmail",
          "country",
          "shipping",
          "shippingChoices",
          "totals",
          "offers",
          "giftCards",
          "giftCardProblems",
          "giftCardCodes",
          "badGiftCards",
          "prices",
          "customer",
          "account",
          "pricesCheckedAt",
          "problems",
          "orderId",
          "needsShipping"
        ]
      },
      "CartUpdate": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3,
            "description": "One of the shop's currencies."
          },
          "locale": {
            "type": "string",
            "maxLength": 10,
            "description": "One of the shop's languages."
          },
          "lines": {
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "variantId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "productId": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{24}$"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 999
                },
                "planId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "variantId",
                "quantity"
              ]
            },
            "description": "Replaces every line. A quantity of 0 removes a line. Send each line's planId again to keep it a subscription."
          },
          "add": {
            "maxItems": 50,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "variantId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 40
                },
                "productId": {
                  "type": "string",
                  "pattern": "^[a-f0-9]{24}$"
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 999
                },
                "planId": {
                  "anyOf": [
                    {
                      "type": "string",
                      "minLength": 1,
                      "maxLength": 40
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "variantId",
                "quantity"
              ]
            },
            "description": "Lines to add. Adds to a line already there, up to 999. A planId given here, or null, changes that line's plan."
          },
          "email": {
            "anyOf": [
              {
                "type": "string",
                "format": "email"
              },
              {
                "type": "null"
              }
            ],
            "description": "The shopper. An email that belongs to a customer in a company gives the cart that company's prices and terms."
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ],
            "description": "The shopper's name."
          },
          "phone": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "description": "The shopper's phone."
          },
          "vatNumber": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 20
              },
              {
                "type": "null"
              }
            ],
            "description": "A business buyer's VAT number, such as DE123456789. It can make the order reverse charged."
          },
          "discountCode": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ],
            "description": "A discount code, such as WINTER15."
          },
          "giftCards": {
            "maxItems": 5,
            "type": "array",
            "items": {
              "type": "string",
              "maxLength": 40
            },
            "description": "Gift card codes. Replaces the ones there; [] removes them all. Spaces, hyphens and small letters don't matter."
          },
          "shippingAddress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "company": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "line2": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 160
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20
                  },
                  "city": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "region": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 80
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                  },
                  "phone": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "line1",
                  "postalCode",
                  "city",
                  "country"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Where it goes."
          },
          "billingAddress": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "name": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 120
                  },
                  "company": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 120
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "line1": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 160
                  },
                  "line2": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 160
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "postalCode": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 20
                  },
                  "city": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80
                  },
                  "region": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 80
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "country": {
                    "type": "string",
                    "minLength": 2,
                    "maxLength": 2
                  },
                  "phone": {
                    "default": null,
                    "anyOf": [
                      {
                        "type": "string",
                        "maxLength": 40
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "name",
                  "line1",
                  "postalCode",
                  "city",
                  "country"
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "Where the invoice goes, if not the delivery address."
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "Two letters, such as NO, for shipping choices and VAT before there is an address."
          },
          "shipping": {
            "anyOf": [
              {
                "anyOf": [
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "rate"
                      },
                      "rateId": {
                        "type": "string"
                      },
                      "servicePoint": {
                        "anyOf": [
                          {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 40
                              },
                              "name": {
                                "type": "string",
                                "maxLength": 160
                              },
                              "address": {
                                "type": "string",
                                "maxLength": 240
                              },
                              "carrier": {
                                "type": "string",
                                "maxLength": 60
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "address",
                              "carrier"
                            ]
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "kind",
                      "rateId"
                    ]
                  },
                  {
                    "type": "object",
                    "properties": {
                      "kind": {
                        "type": "string",
                        "const": "pickup"
                      },
                      "locationId": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "kind",
                      "locationId"
                    ]
                  }
                ]
              },
              {
                "type": "null"
              }
            ],
            "description": "A choice from shippingChoices: kind rate with rateId (and a servicePoint for a rate that needs one), or kind pickup with locationId."
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ],
            "description": "A note from the shopper."
          }
        }
      },
      "Checkout": {
        "type": "object",
        "properties": {
          "orderId": {
            "type": "string"
          },
          "reference": {
            "type": "string",
            "description": "Such as NW1042."
          },
          "status": {
            "type": "string",
            "description": "pay: show Stripe's Payment Element with payment. placed: on invoice, or paid in full by gift cards.",
            "enum": [
              "pay",
              "placed"
            ]
          },
          "payment": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "payment"
                ]
              },
              "clientSecret": {
                "type": "string",
                "description": "For Stripe's Payment Element."
              },
              "publishableKey": {
                "type": "string",
                "description": "The shop's own Stripe publishable key."
              },
              "amount": {
                "type": "integer",
                "description": "What the card pays. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "currency": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "clientSecret",
              "publishableKey",
              "amount",
              "currency"
            ]
          }
        },
        "required": [
          "orderId",
          "reference",
          "status",
          "payment"
        ]
      },
      "Download": {
        "type": "object",
        "properties": {
          "grantId": {
            "type": "string"
          },
          "lineId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "filename": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "description": "Bytes."
          },
          "url": {
            "type": "string",
            "description": "Works for 7 days. Read again for a fresh one."
          },
          "downloads": {
            "type": "integer",
            "description": "Used."
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "usable": {
            "type": "boolean"
          }
        },
        "required": [
          "grantId",
          "lineId",
          "title",
          "filename",
          "size",
          "url",
          "downloads",
          "limit",
          "expiresAt",
          "usable"
        ]
      },
      "Order": {
        "type": "object",
        "description": "An order for a thank-you or order page.",
        "properties": {
          "reference": {
            "type": "string",
            "description": "Such as NW1042."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "cancelled",
              "closed"
            ]
          },
          "paymentStatus": {
            "type": "string",
            "enum": [
              "pending",
              "paid",
              "failed",
              "invoiced",
              "partiallyRefunded",
              "refunded"
            ]
          },
          "fulfilment": {
            "type": "string",
            "enum": [
              "unfulfilled",
              "partial",
              "fulfilled"
            ]
          },
          "placedAt": {
            "type": "string",
            "format": "date-time"
          },
          "currency": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "variantTitle": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": "integer"
                },
                "total": {
                  "type": "integer",
                  "description": "The line total. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                },
                "image": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "title",
                "variantTitle",
                "quantity",
                "total",
                "image"
              ]
            }
          },
          "subtotal": {
            "type": "integer",
            "description": "Before discounts and shipping. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "discountTotal": {
            "type": "integer",
            "description": "Taken off. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "shippingTotal": {
            "type": "integer",
            "description": "Shipping. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "taxTotal": {
            "type": "integer",
            "description": "Tax. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "total": {
            "type": "integer",
            "description": "The order total. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "pricesIncludeTax": {
            "type": "boolean"
          },
          "taxMode": {
            "type": "string",
            "description": "domestic, oss, reverseCharge, export or salesTax."
          },
          "shipping": {
            "type": [
              "string",
              "null"
            ],
            "description": "The rate's or location's name."
          },
          "tracking": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "carrier": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "carrier",
                "number",
                "url"
              ]
            },
            "description": "One entry per parcel."
          },
          "email": {
            "type": "string"
          },
          "downloads": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Download"
            },
            "description": "One for each file bought."
          }
        },
        "required": [
          "reference",
          "status",
          "paymentStatus",
          "fulfilment",
          "placedAt",
          "currency",
          "lines",
          "subtotal",
          "discountTotal",
          "shippingTotal",
          "taxTotal",
          "total",
          "pricesIncludeTax",
          "taxMode",
          "shipping",
          "tracking",
          "email",
          "downloads"
        ]
      },
      "AccountOrder": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "description": "Such as NW1042."
          },
          "status": {
            "type": "string",
            "enum": [
              "open",
              "cancelled",
              "closed"
            ]
          },
          "paymentStatus": {
            "type": "string",
            "enum": [
              "pending",
              "paid",
              "failed",
              "invoiced",
              "partiallyRefunded",
              "refunded"
            ]
          },
          "fulfilment": {
            "type": "string",
            "enum": [
              "unfulfilled",
              "partial",
              "fulfilled"
            ]
          },
          "placedAt": {
            "type": "string",
            "format": "date-time"
          },
          "currency": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "variantTitle": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": "integer"
                },
                "total": {
                  "type": "integer",
                  "description": "The line total. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                },
                "image": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "title",
                "variantTitle",
                "quantity",
                "total",
                "image"
              ]
            }
          },
          "subtotal": {
            "type": "integer",
            "description": "Before discounts and shipping. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "discountTotal": {
            "type": "integer",
            "description": "Taken off. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "shippingTotal": {
            "type": "integer",
            "description": "Shipping. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "taxTotal": {
            "type": "integer",
            "description": "Tax. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "total": {
            "type": "integer",
            "description": "The order total. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "pricesIncludeTax": {
            "type": "boolean"
          },
          "taxMode": {
            "type": "string",
            "description": "domestic, oss, reverseCharge, export or salesTax."
          },
          "shipping": {
            "type": [
              "string",
              "null"
            ],
            "description": "The rate's or location's name."
          },
          "tracking": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "carrier": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "number": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "carrier",
                "number",
                "url"
              ]
            },
            "description": "One entry per parcel."
          },
          "email": {
            "type": "string"
          },
          "reorder": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "productId": {
                  "type": "string"
                },
                "variantId": {
                  "type": "string"
                },
                "quantity": {
                  "type": "integer"
                }
              },
              "required": [
                "productId",
                "variantId",
                "quantity"
              ]
            },
            "description": "What to add to a cart for Order again."
          },
          "receipt": {
            "type": "boolean",
            "description": "Whether a receipt or invoice can be downloaded."
          },
          "invoiceNumber": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "reference",
          "status",
          "paymentStatus",
          "fulfilment",
          "placedAt",
          "currency",
          "lines",
          "subtotal",
          "discountTotal",
          "shippingTotal",
          "taxTotal",
          "total",
          "pricesIncludeTax",
          "taxMode",
          "shipping",
          "tracking",
          "email",
          "reorder",
          "receipt",
          "invoiceNumber"
        ]
      },
      "ReturnOptions": {
        "type": "object",
        "properties": {
          "orderReference": {
            "type": "string"
          },
          "open": {
            "type": "boolean",
            "description": "Whether a return can be asked for now."
          },
          "until": {
            "type": [
              "string",
              "null"
            ],
            "description": "The end of the return window.",
            "format": "date-time"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Why not, when open is false."
          },
          "closed": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "cancelled",
              "noReturns",
              "notSent",
              "expired",
              "allReturned",
              null
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lineId": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "variantTitle": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "image": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "left": {
                  "type": "integer",
                  "description": "How many can still come back."
                }
              },
              "required": [
                "lineId",
                "title",
                "variantTitle",
                "image",
                "left"
              ]
            }
          },
          "returns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Return"
            },
            "description": "Returns already asked for."
          }
        },
        "required": [
          "orderReference",
          "open",
          "until",
          "reason",
          "closed",
          "lines",
          "returns"
        ]
      },
      "Return": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "description": "Such as R1001."
          },
          "orderReference": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "requested",
              "approved",
              "rejected",
              "received",
              "refunded",
              "cancelled"
            ]
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "variantTitle": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": "integer"
                },
                "reason": {
                  "type": "string"
                },
                "received": {
                  "type": "integer"
                }
              },
              "required": [
                "title",
                "variantTitle",
                "quantity",
                "reason",
                "received"
              ]
            }
          },
          "note": {
            "type": [
              "string",
              "null"
            ]
          },
          "decisionNote": {
            "type": [
              "string",
              "null"
            ],
            "description": "The shop's message, once approved or rejected."
          },
          "label": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "carrier": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "trackingNumber": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "trackingUrl": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "labelUrl": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "carrier",
              "trackingNumber",
              "trackingUrl",
              "labelUrl"
            ]
          },
          "refundAmount": {
            "type": [
              "integer",
              "null"
            ],
            "description": "What was refunded. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "currency": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "reference",
          "orderReference",
          "status",
          "lines",
          "note",
          "decisionNote",
          "label",
          "refundAmount",
          "currency",
          "createdAt"
        ]
      },
      "ReturnRequest": {
        "type": "object",
        "properties": {
          "reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 40
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "lines": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "lineId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 20
                },
                "quantity": {
                  "type": "integer",
                  "minimum": 1,
                  "maximum": 999
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "tooSmall",
                    "tooBig",
                    "notAsDescribed",
                    "damaged",
                    "wrongItem",
                    "changedMind",
                    "other"
                  ]
                }
              },
              "required": [
                "lineId",
                "quantity",
                "reason"
              ]
            }
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 1000
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "reference",
          "email",
          "lines"
        ]
      },
      "GiftCardBalance": {
        "type": "object",
        "properties": {
          "last4": {
            "type": "string"
          },
          "balance": {
            "type": "integer",
            "description": "What is left on it. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "currency": {
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "usable": {
            "type": "boolean"
          }
        },
        "required": [
          "last4",
          "balance",
          "currency",
          "expiresAt",
          "usable"
        ]
      },
      "ServicePoint": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "description": "Pass in shipping.servicePoint."
          },
          "name": {
            "type": "string"
          },
          "address": {
            "type": "string"
          },
          "carrier": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "name",
          "address",
          "carrier"
        ]
      },
      "SavedAddress": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "company": {
            "type": [
              "string",
              "null"
            ]
          },
          "line1": {
            "type": "string"
          },
          "line2": {
            "type": [
              "string",
              "null"
            ]
          },
          "postalCode": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "country": {
            "type": "string"
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "defaultShipping": {
            "type": "boolean"
          },
          "defaultBilling": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "company",
          "line1",
          "line2",
          "postalCode",
          "city",
          "region",
          "country",
          "phone",
          "defaultShipping",
          "defaultBilling"
        ]
      },
      "AddressInput": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "company": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 120
              },
              {
                "type": "null"
              }
            ]
          },
          "line1": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "line2": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 160
              },
              {
                "type": "null"
              }
            ]
          },
          "postalCode": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 80
          },
          "region": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 80
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2
          },
          "phone": {
            "default": null,
            "anyOf": [
              {
                "type": "string",
                "maxLength": 40
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultShipping": {
            "type": "boolean"
          },
          "defaultBilling": {
            "type": "boolean"
          }
        },
        "required": [
          "name",
          "line1",
          "postalCode",
          "city",
          "country"
        ]
      },
      "Customer": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "description": "The sign-in. It can't be changed."
          },
          "name": {
            "type": "string"
          },
          "company": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "name": {
                "type": "string"
              },
              "terms": {
                "type": "string",
                "enum": [
                  "card",
                  "invoice"
                ]
              },
              "termsDays": {
                "type": "integer"
              }
            },
            "required": [
              "name",
              "terms",
              "termsDays"
            ]
          },
          "account": {
            "type": [
              "object",
              "null"
            ],
            "description": "The linked MAM account.",
            "properties": {
              "number": {
                "type": "string"
              },
              "status": {
                "type": "string",
                "enum": [
                  "linked",
                  "unknown",
                  "stopped"
                ]
              },
              "onStop": {
                "type": "boolean"
              },
              "creditLimit": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The credit limit. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "balance": {
                "type": [
                  "integer",
                  "null"
                ],
                "description": "The balance. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
              },
              "branch": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "branchName": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "number",
              "status",
              "onStop",
              "creditLimit",
              "balance",
              "branch",
              "branchName"
            ]
          },
          "pendingRequest": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "accountNumber": {
                "type": "string"
              },
              "requestedAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "accountNumber",
              "requestedAt"
            ]
          },
          "priceList": {
            "type": [
              "string",
              "null"
            ],
            "description": "The company's price list."
          },
          "phone": {
            "type": [
              "string",
              "null"
            ]
          },
          "marketing": {
            "type": "boolean",
            "description": "Agreed to marketing email."
          },
          "addresses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SavedAddress"
            }
          },
          "deletionRequestedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "required": [
          "email",
          "name",
          "company",
          "account",
          "pendingRequest",
          "priceList",
          "phone",
          "marketing",
          "addresses",
          "deletionRequestedAt"
        ]
      },
      "Subscription": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "incomplete",
              "active",
              "pastDue",
              "cancelling",
              "cancelled"
            ]
          },
          "every": {
            "type": "string",
            "description": "Such as Every month."
          },
          "amount": {
            "type": "integer",
            "description": "Each period. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
          },
          "currency": {
            "type": "string"
          },
          "lines": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "title": {
                  "type": "string"
                },
                "variantTitle": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "quantity": {
                  "type": "integer"
                }
              },
              "required": [
                "title",
                "variantTitle",
                "quantity"
              ]
            }
          },
          "nextAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "The next payment, or the end for one that is cancelling.",
            "format": "date-time"
          },
          "orders": {
            "type": "integer",
            "description": "Orders so far."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "required": [
          "id",
          "email",
          "name",
          "status",
          "every",
          "amount",
          "currency",
          "lines",
          "nextAt",
          "orders",
          "createdAt"
        ]
      },
      "PersonalPrices": {
        "type": "object",
        "properties": {
          "account": {
            "type": [
              "string",
              "null"
            ],
            "description": "The MAM account number."
          },
          "priceList": {
            "type": [
              "string",
              "null"
            ]
          },
          "onStop": {
            "type": "boolean"
          },
          "checkedAt": {
            "type": [
              "string",
              "null"
            ],
            "description": "When MAM answered.",
            "format": "date-time"
          },
          "products": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "slug": {
                  "type": "string"
                },
                "currency": {
                  "type": "string"
                },
                "source": {
                  "type": "string",
                  "enum": [
                    "shop",
                    "priceList",
                    "account",
                    "loading",
                    "unavailable"
                  ]
                },
                "price": {
                  "type": "object",
                  "properties": {
                    "min": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Lowest. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                    },
                    "max": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Highest. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                    },
                    "currency": {
                      "type": "string"
                    },
                    "compareAt": {
                      "type": [
                        "integer",
                        "null"
                      ],
                      "description": "Before a sale. In minor units of the currency, so 349900 with NOK is NOK 3,499.00."
                    }
                  },
                  "required": [
                    "min",
                    "max",
                    "currency",
                    "compareAt"
                  ]
                },
                "available": {
                  "type": "boolean"
                },
                "variants": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Variant"
                  }
                }
              },
              "required": [
                "id",
                "slug",
                "currency",
                "source",
                "price",
                "available",
                "variants"
              ]
            }
          }
        },
        "required": [
          "account",
          "priceList",
          "onStop",
          "checkedAt",
          "products"
        ]
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "An API key, com_pk_… or com_sk_…. Optional. A com_sk_ key reads draft products, from a server only."
      },
      "apiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Api-Key",
        "description": "The same key in another header."
      }
    }
  }
}
